Tips & Troubleshooting

'This page explains use of the Template Content field in Mail Merge templates.

Below are some tips to help when things don't work out right.

General tips

  • Start with our included Additional CSS and customise from there

  • Most HTML tags require a matching opening and closing tag — use indenting to track them — e.g. align <p> and </p> and indent its content

  • Use an HTML editor to avoid HTML coding mistakes

  • Develop your layout first, and then insert your tokens

  • Copy the tokens directly from the Merge Template form to save typos.

Use CSS classes and semantic tags rather than inline styles

The system comes with a default set of CSS classes and semantic tags

  • Structure your page with CSS classes (e.g. right-box, left-box) and semantic tags (<article>, <address>)

  • Format your text using CSS classes (e.g. center-text, warning-text, small-text) and semantic tags (<strong>, <em>)

If you need to make changes to how these semantic styles look, these can be controlled in the Advanced CSS field of the merge template. You can also define further classes there.

While inline styles are possible (e.g. <div style="color:red"> ), try to avoid them because they lead to inconsistencies and can also be blocked by our security subsystem.

Using a local HTML editor for faster development

While building HTML templates can be difficult, it is possible to get a head start on your fixed layout by using an HTML code editor on your computer.

  1. Use a code editor such as Visual Studio Code (free from Microsoft)

  2. Create the HTML below to contain the structure of your page

  3. Insert the Base CSS and Additional CSS into the document

  4. Your template HTML lives within the <body> tag. Make all your changes there, and to your Additional CSS style. Do not edit the Base CSS or HTML outside of the body tag.

  5. To preview a page, open the page in Google Chrome or Microsoft Edge and print to PDF.

  6. Repeat steps 4 and 5 until you're happy with the results.

  7. When done, copy all your HTML inside the <body> section into the HTML Template field of the merge template, and copy your Additional CSS into the Additional CSS field.

While this approach won't allow you to use the full template replacement and conditional logic features, it will allow you to quickly sort out most layout issues.

<html>
<head>
    <style id="base">
        /* Insert the Base CSS stylesheet here */
    </style>
    <style id="additional">
        /* Insert the Additional CSS here, along with your own rules */
    </style>
</head>
<body>
    <!-- Insert your HTML here -->
</body>
</html>

Troubles saving a merge template? It might be your HTML.

Sometimes you may receive a message "Your item cannot be saved" when trying to save a custom mail merge template.

This can be because our Web Application Firewall (WAF) monitors for "HTML injection" threats, and it has mistakenly detected a threat in your HTML/CSS.

If you encounter this issue, here's some things to check:

  • Avoid inline styles, particularly those that try to insert hidden text or those that re-position text

  • Keep your HTML template as simple as possible using semantic elements and classes

  • Avoid defining styles using a <style> tag. If you need more CSS classes, you can define them in the Advanced CSS field instead.

If you can't resolve the issue, send us a copy of your HTML via the service desk and we can help to resolve the issue.

Last updated

Was this helpful?