Mautic Community Forums

Conditional E-Mail Content

Hi there,



I guess, {leadfield=xy} is some kind of placeholder from a template system Mautic uses to generate emails. Is that correct? If yes, is it (or will it be) possible to do things like:

Code:
{if leadfield=xy == 'ab'} Print case 1 text {else} Print case 2 text {/if}

In my case, I am offering multiple white papers which are available via form registration and download email. Currently, I have to implement a form, a campaign and two emails per white paper - which can be done, but is not very convenient. The approach mentioned above would be really helpful to create on email template for multiple purposes, depending on lead, campaign or list data.

Thank you,
Peter

Hi there,

I guess, {leadfield=xy} is some kind of placeholder from a template system Mautic uses to generate emails. Is that correct? If yes, is it (or will it be) possible to do things like:

{if leadfield=xy == 'ab'} Print case 1 text {else} Print case 2 text {/if}

In my case, I am offering multiple white papers which are available via form registration and download email. Currently, I have to implement a form, a campaign and two emails per white paper - which can be done, but is not very convenient. The approach mentioned above would be really helpful to create on email template for multiple purposes, depending on lead, campaign or list data.

Thank you,
Peter

Your request would be solved by implementing Twig template language to Mautic emails I think. It had been reported at

https://github.com/mautic/mautic/issues/849

Feel free to comment on that feature request.

Has this been implemented as of 1.3.1?

No, not yet. The link to GitHub above shows it’s still opened and marked as 2.0.0 milestone. Probably because it will break backwards compatibility so it has to be released in the major version.

Twig support for Mautic themes has been added in 1.3. Twig conditions in the email content will be added in 2.0

Thanks @escopecz

Hi there, just to confirm, was this added in 2.0 finally? Anybody has some simple examples if so?

Thanks

The feature request is still open. Seems that the issue is discontinued.

BUT: There is dynamic content in Mautic. Does this work for you?