Dynamic content templates with an external database

Flexmail's HTML editor supports creating a message template that is automatically populated with data from an external database delivered as XML. This is a developer feature for automated, data-driven email generation.

A typical use case: a company sends a weekly digest to each customer showing the specific products or updates relevant to them, pulled from a live product database. Instead of building one email per customer, they create one template and let the XML data fill in the variables.


Prerequisites

  • Familiarity with HTML and XML. This feature requires technical knowledge, if you're a marketer and not a developer, coordinate with your technical team before setting this up.
  • Access to the HTML editor in Flexmail.
  • An external database or system that can export data as an XML file in the correct structure.

Support tip  This feature requires familiarity with HTML and XML. The Email builder's built-in dynamic content is a better fit for most marketing use cases. Only use this feature when your content is genuinely driven by a regularly updated external data source.


How it works

You create a message template in the HTML editor using variable placeholders you define yourself, for example [$title], [$article.header1], [$article.image]. While generating the message, these variables are replaced with values from an XML file you provide. The XML structure must match the variable names in your template.


When to use this

  • Automated product digests or inventory emails.
  • Automated booking or reservation confirmations with variable details.
  • Weekly summary emails built from a live data feed.
  • Any use case where the message content is driven by a regularly updated external data source.

Set it up

  1. Create your message template in the HTML editor. Use [$variable_name] syntax for every piece of data that will come from the XML.
  2. Using the cogwheel in the message overview, save the message as a template
  3. Build your XML with fields that match your variable names exactly.
  4. When creating your message, tick the "Use XML input" box and insert your XML in the text field.
  5. Select the template from step 2
  6. Click save. Flexmail now processes the template and XML to generate the final message.

Common mistakes to avoid

  • Variable name mismatches between the template and XML. Every [$variable_name] in the template must have an exact match in the XML. A mismatch leaves the variable unreplaced in the output.
  • Using this feature when the Email builder's dynamic content would suffice. Segment-based conditional sections in the Email builder cover most personalisation needs without requiring external data feeds.

Next steps

Did this answer your question? Thanks for your feedback There was a problem submitting your feedback. Please try again later.

Didn't find what you were looking for? Contact Us Contact Us