# Email template syntax

**URL:** <https://forum.mautic.org/t/email-template-syntax/10019>\
**Category:** Product Support\
**Created:** [November 30, 2017, 7:01pm UTC](https://forum.mautic.org/t/email-template-syntax/10019 "2017-11-30T19:01:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![xpaz](https://avatars.discourse-cdn.com/v4/letter/x/ee7513/32.png) [@xpaz](https://forum.mautic.org/u/xpaz)\
**Post date:** [November 30, 2017, 7:01pm UTC](https://forum.mautic.org/t/email-template-syntax/10019/1 "2017-11-30T19:01:37Z")

</div>

Hi,  
  
  
  
What can be done in emails for personalization? I only find the syntax to put a contact field value: {leadfield=fieldname}.  
  
  
  
Right now I would need a way to insert conditional text, based on the value of a field, or whether it has any value. My current case is the contact’s name - I want to greet them, but not all have the name on record, and I don’t want the first line to read “Greetings, ,”.  
  
  
  
Also, are subject lines parsed?  
  
  
  
Is it possible to include PHP somehow in templates?  
  
  
  
Regards,  
  
Xavier

---

<div class="post-metadata">

**Author:** ![xpaz](https://avatars.discourse-cdn.com/v4/letter/x/ee7513/32.png) [@xpaz](https://forum.mautic.org/u/xpaz)\
**Post date:** [November 30, 2017, 7:01pm UTC](https://forum.mautic.org/t/email-template-syntax/10019/2 "2017-11-30T19:01:37Z")

</div>

Hi,

What can be done in emails for personalization? I only find the syntax to put a contact field value: {leadfield=fieldname}.

Right now I would need a way to insert conditional text, based on the value of a field, or whether it has any value. My current case is the contact’s name - I want to greet them, but not all have the name on record, and I don’t want the first line to read “Greetings, ,”.

Also, are subject lines parsed?

Is it possible to include PHP somehow in templates?

Regards,  
Xavier

---

<div class="post-metadata">

**Author:** ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)\
**Post date:** [December 1, 2017, 9:27am UTC](https://forum.mautic.org/t/email-template-syntax/10019/3 "2017-12-01T09:27:11Z")

</div>

@xpaz can you share screen shot …have you gone trough email builder ?

---

<div class="post-metadata">

**Author:** ![xpaz](https://avatars.discourse-cdn.com/v4/letter/x/ee7513/32.png) [@xpaz](https://forum.mautic.org/u/xpaz)\
**Post date:** [December 1, 2017, 12:15pm UTC](https://forum.mautic.org/t/email-template-syntax/10019/4 "2017-12-01T12:15:17Z")

</div>

Hi,

Thanks, I was looking in the docs, I had not seen the dynamic content in the email builder. It looks good, I will try it now.

I have also seen that subject lines do get parsed for contact fields.

The only remaining questions are, is it possible to include short conditional statements in templates, for small variations in wording? And it is possible to include PHP code? I.e. to capitalize or normalize fields, or to apply more complex logic.

Xavier

---

<div class="post-metadata">

**Author:** ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)\
**Post date:** [December 1, 2017, 12:24pm UTC](https://forum.mautic.org/t/email-template-syntax/10019/5 "2017-12-01T12:24:04Z")

</div>

@xpaz what version your mautic?

---

<div class="post-metadata">

**Author:** ![xpaz](https://avatars.discourse-cdn.com/v4/letter/x/ee7513/32.png) [@xpaz](https://forum.mautic.org/u/xpaz)\
**Post date:** [December 1, 2017, 3:50pm UTC](https://forum.mautic.org/t/email-template-syntax/10019/6 "2017-12-01T15:50:40Z")

</div>

v2.11.0

---

<div class="post-metadata">

**Author:** ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)\
**Post date:** [December 1, 2017, 3:57pm UTC](https://forum.mautic.org/t/email-template-syntax/10019/7 "2017-12-01T15:57:55Z")

</div>

check my profile please
