Skip to main content

FAQ: Email Templates and Placeholders

How do I use my own claim fields in an email template?​

Custom fields you send on the claim are available under meta., for example {{meta.invoiceNumber}}. Standard fields such as {{firstName}} or {{landingPageURL}} need no prefix. A custom field written without meta. is treated as an unknown placeholder. See Placeholders.

What happens when a placeholder has no value for a customer?​

It depends on whether the field exists on the claim:

  • The field exists but is empty: it prints as blank.
  • The field does not exist on the claim: the email is not generated and not sent. The failure lists the missing placeholders.

To make a field optional, wrap it in a condition, {{#if meta.invoiceNumber}}{{meta.invoiceNumber}}{{/if}}, or give it a fallback, {{optional meta.invoiceNumber 'your invoice'}}.

Which placeholder shows the amount, and is it in cents?​

  • {{localizedTotalAmount}} is the total amount including fees, formatted as currency for the email's language, for example "€ 102.00". Use this one in text.
  • {{totalAmount}} is the same amount as a raw number in cents (10200 for 102.00). Use it only where a number in cents is expected, such as the payment QR code.

{{landingPageURL}} is the link to the customer's landing page.

How do I add a call-to-action button to an email?​

Drag a Button element into the email and put {{landingPageURL}} (or another link placeholder) in its URL field. If the email is built as a single HTML block, the drag-and-drop elements cannot be placed inside it. Either add a new row with a Button element above or below the block, or edit the block's HTML and add a link such as <a href="{{landingPageURL}}">Pay now</a>. See Creating an email and Advanced features.

How do I add a SEPA payment QR code to an email?​

Add the QR Code element and use this snippet (or put it in the src of an <img> tag inside an HTML block):

{{sctQRCodeV2 landingPageURL 'BIC' 'IBAN' 'Recipient name' '1' totalAmount 'Payment reference'}}

The arguments are, in order: landing page URL, BIC, IBAN, recipient name, character set ('1'), amount in cents, and payment reference. Any argument can be a placeholder, for example meta.iban. The currency is EUR by default; for other IBAN currencies add it at the end, for example currency='GBP'. sctQRCodeV1 is also available for banking apps that only read the older version of the standard.

The QR code is a standard payment code that the banking app reads directly, so scans cannot be tracked.

My payment QR code does not show, or a banking app rejects it. What should I check?​

  • The whole email failed to generate: the landing page URL is empty, or the currency is not a valid three-letter code.
  • A broken image: the QR image could not be built from the values provided.
  • The QR scans but shows wrong or empty data: the helper does not validate its inputs. An empty IBAN, BIC or reference produces an empty field, and a placeholder that does not exist on the claim prints as the text undefined. Check that every placeholder used in the snippet has a value for that customer, that the amount is in cents, and that the reference fits your bank's rules.

Why don't my test emails arrive?​

Test emails are rendered against a sample claim. Standard placeholders are filled in automatically, but custom meta. placeholders need a value in the Claim metadata / Placeholders section of the Send test email dialog. If one is missing, the email cannot be rendered and is not sent. See Test email.

Can I copy or export the text of an email template, or of all templates at once?​

There is no export for email templates. To get a template's text, open it in the email builder and copy the text of each block, or send yourself a test email and copy from it. Clone creates a copy of a template inside the Backoffice.

Can I do calculations and date formatting in a template?​

Yes. Templates use Handlebars, with helpers such as:

  • multiply, divide and add for arithmetic, and numberFormat for number formatting.
  • {{#gt a b}}...{{else}}...{{/gt}} for comparisons.
  • {{localizedCurrentDate}} for today's date, and {{dateAdd dueDate 15 "days" "DD.MM.YYYY"}} for a date a set time after another date.
  • append to add text to a value.

Use the raw amount in cents for calculations; localizedTotalAmount is already formatted text.

The template editor warns about a placeholder. Can I still save?​

Yes. The placeholder check shows a warning with a Save anyway option. Fix the placeholder before the template is used, because an unknown placeholder stops the email from being generated.