Articles on: Campaign and Automation

How to Use Variables/Merge Tags in Email Subject Lines


Creating personalized email subject lines can improve open rates and engagement with your audience. ShopAgain allows the use of various variables or "merge tags" in email subject lines, similar to those available in email templates. This guide will walk you through the available variables and how to use them effectively in your subject lines.

For a deeper understanding of using variables in email templates, read our guide: How to Use Variables/Merge Tags in the Email Template.

Available Variables for Email Subject Lines

The following variables available for email templates are also supported in subject lines. To insert them, wrap the variable name in double curly braces, like so: {{VariableName}}.

{{FirstName}}: First name of the user
{{LastName}}: Last name of the user
{{UserCity}}: City of the user
{{CompanyName}}: Name of the company
{{CompanyWebsite}}: Website of the company
{{CompanyAddress}}: Address of the company
{{CompanyEmail}}: Contact email of the company
{{CompanyPhone}}: Contact phone number of the company
{{UnsubscribeLink}}: Adds an unsubscribe link with the text "Unsubscribe" to the template
{{CampaignUnsubscribeLink}}: Adds an unsubscribe link to opt out of a specific campaign
{{CampaignUnsubscribeUrl}}: URL to unsubscribe from the campaign
{{SubscribeLink}}: A link for confirming email subscription
{{AbandonedCartUrl}}: Link to the abandoned cart
{{DiscountCode}}: Display the selected discount code. (Requires a configured discount block within the email template. How to add)
{{DiscountCodeUrl}}: A link to apply a discount code. (Requires a configured discount block within the email template. How to add)
{{OrderStatusUrl}}: URL pointing to the order status page
{{OrderNumber}}: Order number
{{OrderAmount}}: Total price of the order

Special Conditions for Discount Variables

The {{DiscountCode}} and {{DiscountCodeUrl}} variables require a discount block to be configured within the email template attached to the email. The discount code must also be created in ShopAgain for these variables to function correctly.

- How to create a discount code

Using Variables in Subject Lines

To use a variable in your email subject line, insert it where needed. For example:

{{FirstName}}, unlock your discount with {{DiscountCodeUrl}}!

Default Values for Missing Information

In cases where some user information might be missing, you can use default values to ensure your subject lines are still coherent and effective.

The format to specify default values is:

{{ VariableName | default:"DefaultValue" }}

For more details on setting up default values, please refer to our guide: How to Use Default Values for Template Variables in ShopAgain.


For the {{FirstName}} variable:

Hello {{ FirstName | default:'Customer' }}, your order is ready!

If the user's first name is not available, the subject line will default to:

Hello Customer, your order is ready!


Effective use of variables and default values in your email subject lines can boost the impact of your marketing efforts. Be sure to take full advantage of this feature to better engage with your customer base.

For a more comprehensive guide to ShopAgain’s template variables, please see How to Use Variables/Merge Tags in the Email Template.

Updated on: 12/09/2023

Was this article helpful?

Share your feedback


Thank you!