Adding dynamic info
When we want to add dynamic info into the body of an email template we need to use certain codes.
This code will display the first name. All codes will start with <%= and end with %> and don’t allow for more than one space, it’s advised to not use spaces at all.
To add a field we need the external ID of that field. You can find the external ID under developer under the wrench icon of the app.
You will see the list of fields in the app
Here you can see that some of the labels are different than the external ID. For example the label "first name" and the external ID "titel". We need the external ID to make the code work.
In every code we also need to change the dash into an underscore. The code to display the lastname would be
This would not work:
<%=x.val(:last-name)%> (Because of the dash)
<%= x.val(:last_name) %>
(Because of the spaces)
Adding dynamic info with a relationship to another app
Adding relationship fields into an email template requires a different code. In the developer window you can check for all app type fields. These fields will require the different code because they have a relationship with another app.
If we want to add an app field into an email template we need to use the following code.
In this case we link to an app called 'Parents' and the field we want to display is the last name of the parent. Just add the external ID of the relationship field you want to use instead of External ID 'Parent' and the external ID of the field from the app 'Parent' instead of last_name.