Jump to content

Email Templates - Blank Variables inserting


Martyn Houghton

Recommended Posts

At the moment when using a variable in an Email Template, the system will correctly insert the value when the field has a value, but when it is empty/null the email has the variable name inserted rather than just inserting nothing.

email_null_var.PNG.3e25349baa160979cd2447ee433905f4.PNG

Could the system be changed so when the variable is blank nothing is inserted or if not, perhaps an option to include a standard value such 'No set' or 'No Value'.

Cheers

Martyn

Link to comment
Share on other sites

@James Ainsworth @SJEaton

Thanks for the guidance, which does get around the problem of the variable name being inserted, just that it would be good if this was done automatically by the product, given that you have to do this for each variable that may be empty. When you are creating and maintaining a large number of templates this does seem unnecessary.

Cheers

Martyn

Link to comment
Share on other sites

@James Ainsworth

Just to follow this up, the ESP Expression only work in the body of the email. If you want to include a field on the subject line, such as we do the customer reference which may be supplied or may be blank, the expression does not work and you still get the variable name inserted.

Therefore at the moment we are not able to include the customer's reference in the subject line.

Cheers

Martyn

Link to comment
Share on other sites

  • 1 month later...

@James Ainsworth

This is becoming an issue for us with email integration with third parties as they require the reference to be in the subject line and it is not possible to use a different email template from the request email option as there is no option to override the subject line or template.

We could get around this if we could include the custom field on the subject line in the template which would be blank most of the time, but cannot do this at the moment as the field name will get inserted instead.

Cheers

Martyn

 

Link to comment
Share on other sites

@Martyn Houghton

Have you taken a look a Email Template Variable Modifiers? https://wiki.hornbill.com/index.php/Email_Templates

You can add |empty inside the {{ }} variable markup and this will remove the variable if it does not have a value, removing the requirement to use ESP Conditions and these modifiers will work in the subject of the email.

Like this:

{.h_variable}}

{{.h_variable|empty}}


Kind Regards

Trevor Killick

Link to comment
Share on other sites

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...