Template management for Transactional emails in Sanity

Template management for Transactional emails in Sanity

This feature in Sanity provides centralized management of email and SMS templates for various transactional communications, including:

  • OTP (One-Time Passwords)

  • Receipts

  • Cancellations

  • Refunds

  • Registrations

  • User blocking and unblocking

  • SMS OTP

Important Note: This feature will only impact production once the market has been fully migrated from Braze to AWS for transactional emails. Until the migration is complete, Braze will continue to handle the sending of these communications.

 

To access the templates in Sanity go to Platform configurations>Email templates>Manage Templates

image-20240929-202721.png

 

On the left You will find then Template and Content Blocks selection area:

image-20240929-202839.png

Once you select one of the templates or Content blocks the code will display in the middle section and a preview will also appear on the right of the screeen:


image-20240929-203050.png

All templates are managed in HTML format, offering flexibility and customization for different types of communication. In addition to the main template management, a dedicated section is available for configuring and setting up reusable content blocks that can be seamlessly integrated into the core templates. This ensures consistency in messaging and branding across various emails.

For the Order Transactional Email templates, specific data call formats must be followed to retrieve dynamic values from transactions. Here's an example of the required change:

  • Old format (in Braze):

    {% if {{event_properties.${language}}} == 'en' %}

  • New format (in Sanity):

    {% if data.language == 'en' %}

These updated formats need to be used to correctly pull dynamic data into transactional emails.

To change the variables of the template to catter a specific change in the preview like language, prices or other variable values you can use the Template Variables field:

image-20240929-203321.png

 

Once the changes to the template are edited in a correct way and the preview is satisfactory, you need to click on Save in the Manage templates page and then Pubish the changes once the Manage templates page closes, Only after Saving and Publishing the email templates will show correctly when tested.

 

Related content