With Twig, you can use properties of the current mailing in your email content. For example, you can automatically display the subject line, sender or send date.
Where can you use these variables?
You can use these variables in HTML that supports Twig, such as the HTML of a template, layout or content block in the drag-and-drop editor.
Place a variable between double curly brackets:
{{ mailing.subject }}The final value is inserted when the mailing is processed. Always check the result in a preview or test mailing.
General mailing properties
| Variable | Description |
|---|---|
mailing.id | The internal ID of the mailing. |
mailing.name | The internal name of the mailing. |
mailing.subject | The subject line of the mailing. |
mailing.lang | The language code of the mailing. |
mailing.campaign_id | The internal ID of the campaign to which the mailing is linked. |
mailing.campaign_name | The name of the campaign to which the mailing is linked. |
mailing.sendout_id | The ID of the sendout. This value is not available in every context. |
mailing.has_triggers | Indicates whether the mailing uses triggers. The value is true or false. |
Sender and reply address
| Variable | Description |
|---|---|
mailing.sender_name | The sender name. |
mailing.sender_email | The sender email address. |
mailing.reply_name | The name configured for replies. This value can be empty. |
mailing.reply_email | The reply address of the mailing. This value can be empty. |
The following, more readable variables are also available for sender and reply details:
{{ sender.name }}
{{ sender.email }}
{{ reply.name }}
{{ reply.email }}Prefer these variants when you only need sender or reply details.
Date and time
Mailing send date
Use mailing.sendDate to display the send date:
{{ mailing.sendDate|date("d-m-Y") }}Example output:
28-08-2026
Other formats include:
{{ mailing.sendDate|date("d-m-Y H:i") }}
{{ mailing.sendDate|date("Y-m-d") }}The send date depends on the context in which the mailing is processed. Always check the value in a preview, test mailing or actual sendout.
Current date and time
Use "now" to display the date and time at which the content is processed:
{{ "now"|date("d-m-Y") }}In a sent email, the inserted value remains unchanged. In the online web version, "now" is recalculated whenever the page is opened. The displayed date can therefore change over time.
This is useful, for example, for automatically displaying the current year in a trademark or copyright notice:
© {{ "now"|date("Y") }} Company nameUse mailing.sendDate when the original send date must remain visible, for example to show the edition or publication date of a newsletter:
Newsletter dated {{ mailing.sendDate|date("d-m-Y") }}Processing context
The following variables describe the context in which MailPro processes the mailing. They are mainly intended for advanced templates and conditional logic.
| Variable | Description |
|---|---|
mailing.inBrowser | true when the mailing is displayed as an online version. |
mailing.testMode | true when the mailing is processed in a test context. |
mailing.preview | true when the mailing is processed as a preview. |
mailing.contactSender | Indicates whether the contact sender is used in the current processing context. |
mailing.tracking_pixel | Indicates whether the tracking pixel is used for the current mailing. |
Example:
{% if mailing.inBrowser %}
This text is displayed in the online version.
{% endif %}Handling empty values
Not every property has a value in every context. This applies, for example, to mailing.sendout_id, mailing.reply_name and mailing.reply_email.
Check the value before displaying it:
{% if mailing.reply_email %}
Reply address: {{ mailing.reply_email }}
{% endif %}Important
- Variables are case-sensitive. Use
mailing.sendDate, for example, and notmailing.senddate. - Some values are internal IDs and are mainly useful in technical templates or troubleshooting.
- Availability and output can differ between a preview, test mailing, sendout and online version.
- Always create a preview and send a test mailing before publishing a template.