# How to setup a condition within an email template

**URL:** <https://forum.mautic.org/t/how-to-setup-a-condition-within-an-email-template/30087>\
**Category:** Product Support\
**Created:** [November 30, 2023, 11:20am UTC](https://forum.mautic.org/t/how-to-setup-a-condition-within-an-email-template/30087 "2023-11-30T11:20:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabrr](https://avatars.discourse-cdn.com/v4/letter/g/3ab097/32.png) [@gabrr](https://forum.mautic.org/u/gabrr)\
**Post date:** [November 30, 2023, 11:20am UTC](https://forum.mautic.org/t/how-to-setup-a-condition-within-an-email-template/30087/1 "2023-11-30T11:20:35Z")

</div>

**Your software**  
My Mautic version is: 4.4.10  
My PHP version is: 8.0.30  
My Database type and version is: MySQL 5.7.35-38

**Your problem**  
Hey!

I’d like to setup a very simple conditon based email template, which would have the same opening and closing text, but a part of the main body would differ based on if the custom field “is\_primary” is 0 or 1.

How can I do that?

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [December 3, 2023, 1:47pm UTC](https://forum.mautic.org/t/how-to-setup-a-condition-within-an-email-template/30087/2 "2023-12-03T13:47:26Z")

</div>

What if you create tow segments and two emails, then send two emails each with different body to a different segment?
