Dynamic content templates with an external database

Flexmail's HTML editor supports creating a message template that is automatically filled with data from an external database, supplied 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 with the specific products or updates that are 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 are 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 choice for most marketing use cases. Only use this feature when your content is actually driven by a regularly updated external data source.


How it works

You create a message template in the HTML editor with variable placeholders that you define yourself, for example [$title]  , [$article.header1]  , [$article.image]  . When the message is generated, these variables are replaced with values from an XML file that you supply. 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 the [$variable_name]   syntax for every piece of data that comes from the XML.
  2. Save the message as a template via the cogwheel icon in the message overview.
  3. Build your XML with fields that match your variable names exactly.
  4. When creating your message, tick the "Use XML input" box and paste your XML into 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 names that do not match between the template and the 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 be enough. 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