How to use variables in email templates.
Our email templating system allows you to insert dynamic variables into your email templates using the {{topic.variable}}
format. These variables will be replaced with actual data when the email is sent. This ensures that your emails are personalized and relevant to each recipient.
You can reference the following variables to insert business-related details:
{{business.name}}
- The name of the business{{business.brandName}}
- The brand name of the business{{business.primaryColor}}
- The primary color associated with the business{{business.accentColor}}
- The accent color of the business{{business.neutralColor}}
- The neutral color of the business{{business.logoId}}
- The ID of the business logo{{business.socialLinkFacebook}}
- Facebook link of the business{{business.socialLinkInstagram}}
- Instagram link of the business{{business.socialLinkPinterest}}
- Pinterest link of the business{{business.socialLinkTwitter}}
- Twitter link of the business{{business.domain}}
- The business domain name{{business.websiteScreenshotUrl}}
- Screenshot URL of the business websiteYou can reference the following variables to personalize emails with customer information:
{{customer.first_name}}
- Customer's first name{{customer.last_name}}
- Customer's last name{{customer.phone}}
- Customer's phone number{{customer.id}}
- Customer's unique identifierThese variables reference customer profiles stored in our system:
{{profile.profileId}}
- Unique identifier for the profile{{profile.firstName}}
- First name from the profile{{profile.lastName}}
- Last name from the profile{{profile.emailAddress}}
- Email address from the profileIf your business has custom profile properties set up, you can reference them using:
{{profile.property.<custom_property_id>}}
- Custom profile propertyIf enabled, you can reference campaign-related details:
{{campaign.id}}
- Unique campaign ID{{campaign.name}}
- Campaign name{{campaign.description}}
- Campaign description{{campaign.start_date}}
- Campaign start date{{campaign.end_date}}
- Campaign end dateThese variables reference events that triggered the email:
{{event.emailAddress}}
- Email address of the recipient{{event.eventType}}
- Type of event that triggered the email{{event.pathname}}
- Pathname of the event occurrence{{event.referrerUrl}}
- URL of the referrer{{event.timestamp}}
- Event timestamp{{event.deviceId}}
- Device ID of the user{{event.sessionId}}
- Session ID{{event.userAgent}}
- User agent string{{event.pageUrl}}
- URL of the page{{event.clickUrl}}
- URL that was clicked{{event.productHandle}}
- Product handle related to the event{{event.productId}}
- Product ID{{event.cartId}}
- Cart ID{{event.emailId}}
- Email ID associated with the event{{event.orderId}}
- Order ID{{event.variantId}}
- Variant ID of the product{{event.searchQuery}}
- Search query performed by the user{{event.browserName}}
- Name of the browser{{event.city}}
- City of the user{{event.country}}
- Country of the user{{event.zip}}
- ZIP code{{event.timezone}}
- User's timezone{{event.region}}
- User's region{{event.regionName}}
- Name of the region{{event.isp}}
- Internet Service Provider{{event.operatingSystem}}
- Operating system used{{event.hashedIp}}
- Hashed IP addressThe system provides access to current date information in various formats:
{{currentDate.date}}
- Full formatted date (e.g., "December 25, 2024"){{currentDate.year}}
- Current year as a number (e.g., 2024){{currentDate.month}}
- Current month name (e.g., "December"){{currentDate.day}}
- Current day of month as a number (e.g., 25)These variables are only available in email templates that are sent by an agent step in a journey execution:
{{agent.productId}}
- Product ID{{agent.message}}
- Custom messageYou may notice that we provide both customer
and profile
variables. The key difference is:
For most use cases, these values will be the same. However, some components (e.g., ConfirmationButton
) require a profile ID from our system.
{{business.id}}
instead of the literal business ID to avoid errors.By following this guide, you can leverage dynamic templating to create personalized and data-driven email campaigns.