Global placeholders
A global placeholder is a value you define once for your whole organisation and reuse in any template. Each one is a property name and a value, for example companyName and Example Ltd.
Use them for text that appears in many templates and may change over time, such as your company name, a support email address, a phone number or opening hours. When the value changes, you update it in one place and every template that references it uses the new value.
Where to find them
Click on 'Content' in the main menu, and then select 'Global placeholders'. The page lists every global placeholder for your organisation, with its property name and value.
Adding a global placeholder
- Click on 'Add' (top right).
- Property name: the name you'll use to reference the placeholder in your templates, for example
supportEmail. It can't contain spaces or dots. We recommend letters and numbers only, written in camelCase. - Value: the text that replaces the placeholder when a message is sent, for example
support@example.com. - Click on 'Create'.
Editing a global placeholder
- Click on the row of the placeholder you'd like to change.
- Change the value. The property name can't be changed once the placeholder is created. To rename a placeholder, create a new one, update your templates to use it, and then delete the old one.
- Click on 'Update'.
Deleting a global placeholder
- Click on the delete icon on the row of the placeholder.
- Confirm the deletion. This action can't be undone.
Before you delete a placeholder, remove it from every template that uses it. See When a placeholder doesn't exist for what happens otherwise.
Using a global placeholder in your content
Global placeholders use the same Handlebars syntax as the other placeholders, with the prefix global. in front of the property name and two curly braces on each side:
{{global.supportEmail}}
This works in the content of:
- Emails
- SMS and other messages created in the Messaging Builder
- Letters
- Landing pages
Global placeholders can also be used inside Handlebars helpers and conditions, like any other placeholder, for example {{#if global.supportPhone}}Call us on {{global.supportPhone}}{{/if}}.
Example: a footer shared by all your templates
Suppose every email ends with your company name and support address. Create two global placeholders:
| Property name | Value |
|---|---|
companyName | Example Ltd |
supportEmail | support@example.com |
Then write the footer of each template like this:
Kind regards,
The {{global.companyName}} team
Questions? Write to us at {{global.supportEmail}}
A customer receives:
Kind regards,
The Example Ltd team
Questions? Write to us at support@example.com
If your support address later changes to help@example.com, edit the supportEmail value once. You don't need to open or save any template.
When a change takes effect
Placeholders are filled in when a message is generated, not when a template is saved. After you change a value:
- Emails, SMS and letters generated from then on use the new value. It can take up to about a minute for the change to reach every message. Messages that were already sent keep the value they were sent with.
- Landing pages that have already been generated for a customer can keep showing the previous value until the page is generated again, for example after the landing page itself is updated.
When a placeholder doesn't exist
A reference to a global placeholder that doesn't exist, because of a typo in the property name or because the placeholder was deleted, is not left empty.
- When you save a template, the email and Messaging Builder editors check its placeholders and list any they don't recognise, including a misspelled global placeholder. If the template has a Context selected (Account Manager, Strategy Builder or Reactions), you need to fix them before you can save. If no Context is selected, you can choose to save anyway.
- When a message is generated, an email, SMS or letter that references a missing global placeholder isn't sent. Its generation fails and the missing placeholder is reported.
- On a landing page, the page content can't be generated for that customer, so the landing page opens without its content. If a copy of the page was generated earlier, that copy can keep being shown until the page is generated again.
Templates are only checked when they are saved. Deleting a global placeholder doesn't warn you about templates that still use it, so remove it from your templates first.