Data
Field
{{Field}}
For Each
{{#each Items}}
{{this.ItemName}}
{{/each}}
If Then
{{#each user.story}}
{{#if this.male}}
<p>{{this.date}}</p>
{{else if this.female}}
<p>{{this.item}}</p>
{{/if}}
{{/each}}
Sources:
https://htmlemail.io/blog/custom-sendgrid-templates
https://sendgrid.com/docs/api-reference/
https://sendgrid.com/docs/for-developers/sending-email/using-handlebars/#handlebarjs-reference
https://docs.sendgrid.com/for-developers/sending-email/using-handlebars#iterations
https://github.com/sendgrid/email-templates/tree/master/dynamic-templates/receipt
Comments