Email templates are created and managed in the backoffice, under 'Instellingen' -> 'Templates'. They contain the content of an email you can send. In these templates different kind of tags can be used to fill in variable data:
-
Table tags are filled in for every record provided, the section is repeated as often as needed.
-
Simple tags are only appearing once and are filled in on the spot.
Table tags can be added by using: <!--[BEGINXX]--> and <!--[ENDXX]--> where XX is the name of the tag. Everything between these tags will be repeated for every row provided when creating the email.
Simple tags appear both in table section and individually. For this use <!--[%XX%]--> Where XX is the name of the tag.
Providing data is done with the Mail Create request by filling in TemplateParameters with a key value collection with the name and value. Like {"Firstname":"John", "Lastname":"Doe"}.
This will convert a template like this:
Hello <!--[%Firstname%]--> <!--[%Lastname%]-->
to
Hello John Doe
For TableTags you need to fill in TemplateTableParameters with a object that lists the tags and has a collection of key value object. Like {"ProductLine":[{"ProductNumber":"0000123","Description":"Hammer"},{"ProductNumber":"0000777",""Description":"Screwdriver"}]}
This will convert a template like this:
<!--[BEGINProductLine]--> <!--[%ProductNumber%]--> <!--[%Description%]--> <br /> <!--[ENDProductLine]-->
to
0000123 Hammer <br />0000777 Screwdriver
You can use multiple simple tags and table tags within the same template.