What are Template Properties?
The Template Properties feature in Spotler MailPro helps you to maintain generic properties that can be seamlessly integrated into your email template(s). This powerful capability allows you to define and reuse dynamic content elements across different levels: license, brand, and campaign. It is possible to maintain these properties, and therefore indirectly your template, via API.
How to Set Up Template Properties
GUI Setup:
To set up Template Properties, your user Role should have the corresponding role rights.
- Navigate to Setup → Properties.
- Click Insert.
- Select the desired level for the property: License, brand, or campaign.
- Give the Property a name. This is the name that you refer to in the template code.
- Give the Property a value. The value will be shown when the property is called in the template.
- Click Ok.
API Setup:
- In our API documentation, navigate to the category Property.
- Utilize the provided API calls to add, update, or retrieve properties on License, Brand, or Campaign level.
How to Use Template Properties
Email Template Integration
In your email template, insert a property using the Twig syntax: {{[level].[propertyname]}}
.
Spotler MailPro dynamically replaces the syntax with the corresponding property value based on the specified level.
Twig Examples
These examples showcase how easily you can personalize your email content using Template Properties at different levels. The values of these properties can be easily adjusted using the GUI or our API.
License-level Property:
Welcome to {{license.company_name}}!
Our latest offer is {{license.special_offer}}.
Brand-level Property:
Discover the new {{brand.product_name}} collection!
Available now at {{brand.store_location}}.
Campaign-level Property:
Limited-time offer: {{campaign.discount_percentage}} off on all purchases!
Use code {{campaign.promo_code}} at checkout.
Example with HTML
It is also possible to insert HTML code via a Property. In that case, you should refer to the Property in your Twig code, including the |raw
filter. For example, if your campaign Property value refers to your homepage:
<a href="https://www.spotler.com">Spotler Home Page</a>
You can use the following code in your template to display the home page:
{{campaign.homepage|raw}}
For further details and more advanced use cases, consult your Account Manager or our Customer Success team.