Learn how to write an email template in Novu. This document will guide you through the process of creating an email template using the Novu email editor, all supported blocks and how to use them
WYSIWYG
editor that allows you to create and edit email templates. It has two fields: Subject
and Body
.
Email Editor
/
. In both the cases, a popover will appear with the list of supported blocks. Click on the desired block to add it to the editor. Menu option besides plus (+) icon can be used to duplicate or delete the block.
Email Editor Blocks
Repeat
block is synonym with the javascript language for
loop. It can be used to iterate over an array of data and render a block for each item in the array. Use + icon or / to add a Repeat
block. Checkout the below video on how to use Repeat
block
In above video:
{{payload.order.items}}
is array of items in the order and can be used to iterate over the items{{payload.order.items.name}}
is the name of the item{{payload.order.items.price}}
is the price of the itemShow Block
showTracking
field set to true
in custom data
attribute, then the Track your order
button will be shown in the email sent to the subscriber. Similarly, paylaod variables can be used to conditionally show the content.