Mautic Community Forums

Additional template functions

I miss two functions in the email templates which are very basic for me and @dirk_s: (We discussed that yesterday on the phone.)



1st: Insert value with fallback

Sometimes the database fields which should be inserted in an email empty. It would be great to have an option here to define a fallback value like in this example:

Code:
Gain new customers for {leadfield=company;fallback="your company"}

2nd: Conditions to change email content
This is even more powerful function which can be used to customize emails better for customers.
For example: I send out an advertisement for product A which works together with product B. I want to check if the customer already purchased that and add that information to the email. Example:
Code:
if(tags:productb){By the way: Our brand new product works together with product B which you already pruchased. Just add ...}

Or you want to send different emails to male and female customers adverting the same product by giving them different arguments.

And this is especially very important for the German language. We differ between "Du" and "Sie" which makes little changes in the words we have to choose.

Yes I know that this can be done with different emails.
But let's say we have to differ between Du and Sie (2 emails), want to differ for genders (4=2*2 emails) and want to check if the customer bought that product B before (8=2*2*2 emails). The next choice will make this 16 emails, one more 32. You see where this is going...

Does anyone has ideas or implementations for that?

I miss two functions in the email templates which are very basic for me and @dirk_s: (We discussed that yesterday on the phone.)

1st: Insert value with fallback
Sometimes the database fields which should be inserted in an email empty. It would be great to have an option here to define a fallback value like in this example:

Gain new customers for {leadfield=company;fallback="your company"}

2nd: Conditions to change email content
This is even more powerful function which can be used to customize emails better for customers.
For example: I send out an advertisement for product A which works together with product B. I want to check if the customer already purchased that and add that information to the email. Example:

if(tags:productb){By the way: Our brand new product works together with product B which you already pruchased. Just add ...}

Or you want to send different emails to male and female customers adverting the same product by giving them different arguments.

And this is especially very important for the German language. We differ between “Du” and “Sie” which makes little changes in the words we have to choose.

Yes I know that this can be done with different emails.
But let’s say we have to differ between Du and Sie (2 emails), want to differ for genders (4=22 emails) and want to check if the customer bought that product B before (8=22*2 emails). The next choice will make this 16 emails, one more 32. You see where this is going…

Does anyone has ideas or implementations for that?