Email notifications
Applies toShopify
How it works
SparkLayer orders are Shopify orders (or draft orders), so customers get Shopify's standard notification emails. Each template is Liquid code you can edit in your Shopify admin. SparkLayer adds the b2b tag to B2B customers and some extra details to their orders. Your templates can use these to show different content to B2B customers.
To edit a template:
- In your Shopify admin, go to Settings,Notifications (opens in your Shopify admin in a new tab).
- Open the template you want to change, for example Order confirmation, and edit its code.
- Test your change by triggering the email (for example, by placing a real order). Test with one customer tagged
b2band one without.
Show B2B-specific content in an email
To show one message to B2B customers and another to everyone else, add this code to a template and change the content as you need:
{% for tag in customer.tags %}
{% if tag == 'b2b' %}
Content to show to B2B
{% else %}
Content to show to DTC
{% endif %}
{% endfor %}Show order details from Additional details
SparkLayer orders can carry extra data as order note attributes, which appear under Additional details on the order in Shopify. You can show these in emails, such as a delivery date or the payment method. For example, an order might have a shipping-date from a custom checkout field and a sparkPaymentType of paymentOnAccount.
Add the code to these templates:
- Order confirmation (opens in a new tab)
- Order invoice (opens in a new tab)
- Draft order invoice (opens in a new tab)
<p>Name of field: {{ attributes.Name of Field }}</p>
<p>Name of field: {{ attributes.Another Name of Field }}</p>For example, to show the shipping date and the payment method:
{{ attributes.shipping-date }}
{{ attributes.sparkPaymentType }}Put the code where it fits in your email layout, and adjust it to match your formatting.
To show the order note:
{% if note != '' %}
Note: {{ note }}
{% endif %}Hide discount pricing
By default, a line item in the email can show the original price struck through, the discount amount and the final price. To show B2B customers only the final price, add this CSS before the closing </head> tag in each of these templates:
- Order confirmation (opens in a new tab)
- Order invoice (opens in a new tab)
- Draft order invoice (opens in a new tab)
{% for tag in customer.tags %}
{% if tag == 'b2b' %}
<style>
.order-list__item-original-price,
.order-list__item-discount-allocation,
p.total-discount {
display: none;
}
</style>
{% else %}
{% endif %}
{% endfor %}Rename the payment method
The order confirmation email shows a payment method at the bottom. To change what it says for B2B payment types, add this to the Order confirmation template:
{% assign sparkPaymentType = attributes.sparkPaymentType %}
{% if sparkPaymentType == 'paymentByInvoice' %}
Invoice Payment [change this to the required payment name]
{% endif %}Customise the account invite email
When you add customers in Shopify yourself, what you can customise depends on the version of customer accounts (opens in a new tab) your store uses.
New customer accounts. Send customers to your store's login page (for example yourstore.com/account), where they enter their email and get a 6-digit access code. You can't customise that email.
Legacy customer accounts. When you create a new customer, send them an account invite:
- In your Shopify admin, open the customer.
- Click More actions, then Send account invite.
The customer gets an email with an Activate your account button, so they can set a password. See Shopify's guide to inviting customers to create accounts (opens in a new tab).
To change the invite email:
- In your Shopify admin, go to Settings,Notifications,Customer notifications (opens in your Shopify admin in a new tab).
- Under Accounts and outreach, open Customer account invite and edit the account activation email (opens in a new tab).
You can make its content B2B-specific with the code in Show B2B-specific content in an email. The same section has the other account emails, such as Customer account welcome and Customer account password reset.
Next steps
Last updated