Hi @genietim Thx for the feedback :) What are you trying to accomplish by sorting email templates? Any further details here would be very helpful!
Hi @Raphael Costa
Thanks for your response. As you say sorting, I am not sure if I understand. I do not want conditions to filter or sort E-Mail templates. I am looking for conditions in the templates. Conditions that change the text/content of the E-Mail.
So, in the example of above: I list all the articles a user selected. This on itself is maybe not the best example as it could be achieved with a more complicated select-list input and some autofill-actions.
I just realized, that what I want to do can already be achieved in any case by using some helper input-text fields and multiple automations triggering on field change, each equipped with some conditions.
The conditions in E-Mail templates would therefore only be simplifying the setup.
Other examples:
- salutation in an E-Mail from two fields: one select: married/unmarried, another select: man/woman. Then, could use
{{if field2 == man}}Mr.{{else}}{{if field1 == married}}Mrs.{{else}}Ms.{{endif}}{{endif}}
. - Potential text only if field is filled in:
{{ if attachment }} You can find the file at {{attachment}}{{endif}}
. - Adabtion of number postfixes:
You have {{ fieldNr }} tree{{ if fieldNr > 1 || fieldNr == 0 }}s{{endif}}
These are rather simple examples as there are practically no interferences between different fields as I have some in upcoming processes. But yes, all these examples can be done with a hidden helper text field that is used in the E-Mail templates and filled using two (resp. 3) automations upon change of the corresponding fields.
I have hear an example that I was not able to replicate using conditions & automations as one cannot put HTML fields in the E-Mail template:
Conditional table rows!
E.g. (simplifying here, the conditions would of course include field specifiers etc., depending on your implementation):
<table>
<tr>
<th>Article</th>
<th>Article Count</th>
</tr>
{{ if field.article1Count > 0 }}
<tr>
<td>Article1</td>
<td>{{ field.article1Count }}</td>
</tr>
{{endif}}
{{ if field.article2Count > 0 }}
<tr>
<td>Article2</td>
<td>{{ field.article2Count }}</td>
</tr>
{{endif}}
{{ if field.article3Count > 0 }}
<tr>
<td>Product3</td>
<td>{{ field.article3Count }}</td>
</tr>
{{endif}}
{{ if field.article4Count > 0 }}
<tr>
<td>Article4</td>
<td>{{ field.article4Count }}</td>
</tr>
{{endif}}
<!-- etc., any many article fields -->
</table>
(Also, it would be nice to be able to edit topics on here, the “hear” instead of the “here” as well as the formatting issues are bugging me. Sorry. Thanks.)