Jump to content

Recommended Posts

Posted

When using variables in emails I can set so it's empty if the Variable does not exist, for example {{Customer Contact.H_jobtitle|empty}}

Is it possible to default to a hard coded value instead? Something along the lines of {{Customer Contact.H_jobtitle|"Mr."}} so that if the customer does not have a title the email displays Mr.

Posted

@HHH sure you can. Use ESP conditions: https://wiki.hornbill.com/index.php/Email_Templates

Tip: once you have a read through, just to get an idea on how this works, the condition you would need is like this:

<esp-condition contenteditable="false" expression="'{{Customer Contact.H_jobtitle}}' LIKE '%Customer Contact.H_jobtitle%'">Mr.</esp-condition>

I know is not obvious why you need that but you do. Just try it and see how it works :) 

EDIT: Btw, the above is an ESP expression from when the email templates is viewed in "Source" mode

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...