Email Templates

LemonStand's default email templates are used for sending email notifications. You can customize templates using HTML, CSS and LemonStand Variables. Navigate to Administration > Email Templates to edit.

The following events trigger an email notification:

  • New orders
  • Customer registrations
  • Payments
  • Billing errors
  • Change in order status
  • Request for password reset
  • System events (contact form submissions, admin user events, etc.)
  • Subscription events (billing success/fail, subscription cancel, etc.)

Note: Email template layouts are independent of themes. Therefore, changing themes will not change the look of email templates.

Email Layouts

All email templates must include an email layout which describes how the email looks. You can change the email layouts to match your store's branding. Navigate to Administration > Email Templates and click on the Email layouts button.


The two default layout are Internal and External which are used for internal and external emails, respectively; however, you can also create a new layouts from scratch.

In the first example we are going to edit the External layout to include our store logo (from the Zest theme). Click on the layout and add this code inside the <body> tag, before the {{ message }} variable:

<div class="logo">
  <a href="http://zest.lemonstand.com">
    <img class="logo" src="https://d2qq4423n7kgsb.cloudfront.net/store-zest-5390a829c1557/themes/zest/resources/images/zest-logo.png">
  </a>
</div>
<div class="logo">  <a href="http://zest.lemonstand.com">
<img class="logo" src="https://d2qq4423n7kgsb.cloudfront.net/store-zest-5390a829c1557/themes/zest/resources/images/zest-logo.png"></a></div>

Next, open the CSS section. Here we can add styling to our layout. Let's position the logo on the right side of the email by adding this code:

.logo {
  float: right;
}

Click the Save button.

Email Variables

For a full reference of the different email template codes, what triggers them and the variables available to them, check out our Cheat Sheet. In the next example we are creating a new email variable and adding it to a couple of email templates. Go back to Email Templates and click on the Email Variables button.


This variable checks to see if there are any Order Notes added by the customer during the checkout process, and prints them.

Click on the Add button and enter a Name and Description for the variable.

Add this to the Code section:

{% if order.notes %}
Order Notes: {{ order.notes }}
{% endif  %}

Click the Save button.

Now go back to Email Templates and click on the shop:new-order-customer template. Add the newly created variable to the end of the Content section:

{{ 'shop:order-notes'|var }}

Click the Save button.

Similarly you can add the variable to the shop:order-status-change-internal template.

Send an Email on Order Status Updates

In this example we will create a new order status with a notification setting to send emails. The email will be sent as soon as an order goes into that status, and can be sent to customers or store administrators. Go to the Business Settings tab, then Order Statuses, and create a new order status.

Select the email template you wish to use for the customer notification, in this example we use the shop:new-order-customer template.

Select the email you wish to use for the store administrators notification, in this example we use the shop:order-status-change-internal template.

Click the Save button.

You can create any order status you require, in combination with custom email templates. The status can be updated manually or through the API.


Trigger Codes and Variable Usage for Email Templates

CodeUsage
shop:order-status-change-internalTriggered when an order status change occurs and is sent to store admin users. Exposes order variables for a particular order as well as explicit variables oldStatus and newStatus for the order status state change.
shop:order-status-change-externalTriggered when an order status change occurs and is sent to the customer who created the order. Exposes order variables and customer variables for a particular order as well as explicit variables oldStatus and newStatus for the order status state change.
shop:registration-confirmation
Triggered when a new customer registers via the store front end. Exposes customer variables for a new customer after they register.
shop:password-restore
Triggered when a customer resets their password from the store front end. Exposes customer variables for the customer who the password restore was completed for as well as an explicit variable for passwordRestorePage, the URL for the store page the password was reset from.
shop:set-new-password
Triggered when a new customer registers without a password (ie. they are created by an admin user or via CSV import but no password is set). Exposes customer variables for the new customer as well as an explicit variable for passwordRestorePage, which can be included in the email as a link so that they can set their password. 
shop:send-quote
Can be manually triggered through the Quote API. Sent to all customer email addresses belonging to the quote. Exposes:
- Quote Variables
Customer variables if the quote has a customer
- Variable quoteLink, which links to the quote for checkout by the customer 
system:contact-message
Triggered when a visitor submits the contact form and sent to all admin users with notifications enabled.
system:password-restore
Triggered when an admin user resets their password from the store administration backend. Exposes user variables for an admin user who resets their password as well as an explicit variable for passwordRestorePage, the admin URL for that the password was reset from.
system:registration-confirmation
Triggered when a new admin user is created. Exposes user variables for an admin user and the site url for the store admin panel.
subscriptions:new-subscription
Sent when a new subscription is created. Exposes customerorder (for the first order related to the subscription), and subscription variables.
subscriptions:upcoming-renewal
Sent x days before a renewal occurs. Exposes customer and subscription variables.
subscriptions:subscription-paused
Sent when a subscription is paused. Exposes customer and subscription variables.
subscriptions:subscription-reactivated
Sent when a subscription is unpaused. Exposes customer and subscription variables.
subscriptions:subscription-cancelled
Sent when a subscription is cancelled. Exposes customer and subscription variables.
subscriptions:order-change
Sent when subscription items change. Exposes customer and subscription variables.
subscriptions:billing-success
Sent when a customer is successfully charged from their subscription. Exposes customer, the currently billed order, and subscription variables.
subscriptions:billing-declined
Sent when we can't charge a customer's credit card. Exposes customer, the currently billed order, and subscription variables.