# Conditional E-Mail Content

**URL:** <https://forum.mautic.org/t/conditional-e-mail-content/2474>\
**Category:** Product Support\
**Created:** [October 5, 2015, 4:20pm UTC](https://forum.mautic.org/t/conditional-e-mail-content/2474 "2015-10-05T16:20:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 5, 2015, 4:20pm UTC](https://forum.mautic.org/t/conditional-e-mail-content/2474/1 "2015-10-05T16:20:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 5, 2015, 4:20pm UTC](https://forum.mautic.org/t/conditional-e-mail-content/2474/2 "2015-10-05T16:20:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [October 7, 2015, 6:44am UTC](https://forum.mautic.org/t/conditional-e-mail-content/2474/3 "2015-10-07T06:44:02Z")

</div>

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](https://github.com/mautic/mautic/issues/849)

Feel free to comment on that feature request.

---

<div class="post-metadata">

**Author:** ![startfinance](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@startfinance](https://forum.mautic.org/u/startfinance)\
**Post date:** [May 3, 2016, 3:20am UTC](https://forum.mautic.org/t/conditional-e-mail-content/2474/4 "2016-05-03T03:20:05Z")

</div>

Has this been implemented as of 1.3.1?

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [May 3, 2016, 6:34am UTC](https://forum.mautic.org/t/conditional-e-mail-content/2474/5 "2016-05-03T06:34:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [May 4, 2016, 6:16am UTC](https://forum.mautic.org/t/conditional-e-mail-content/2474/6 "2016-05-04T06:16:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![startfinance](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@startfinance](https://forum.mautic.org/u/startfinance)\
**Post date:** [May 9, 2016, 1:03am UTC](https://forum.mautic.org/t/conditional-e-mail-content/2474/7 "2016-05-09T01:03:43Z")

</div>

Thanks @escopecz

---

<div class="post-metadata">

**Author:** ![tcore](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tcore/32/13555_2.png) [@tcore](https://forum.mautic.org/u/tcore)\
**Post date:** [December 4, 2017, 12:09pm UTC](https://forum.mautic.org/t/conditional-e-mail-content/2474/8 "2017-12-04T12:09:58Z")

</div>

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

Thanks

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [December 5, 2017, 6:58am UTC](https://forum.mautic.org/t/conditional-e-mail-content/2474/9 "2017-12-05T06:58:11Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [February 2, 2020, 10:58pm UTC](https://forum.mautic.org/t/conditional-e-mail-content/2474/10 "2020-02-02T22:58:00Z")

</div>


