Jump to content

E-mail Template - Null Value Custom Fields


Will J Douglas

Recommended Posts

Hi,

Is it possible to control the behavior of custom fields in e-mail templates where there may be Null values.

E.g

On my prog capture, I check whether external parties are involved and update the relevant custom field.

If no external parties are involved, custom h_custom_j and h_custom_k will still have null / blank values.

On the notification e-mails, the custom field variable definition is displayed when the value is Null - see below.

I would rather this be blank or showing NA (not applicable).

 

External parties involved?:  No

External party details: {{.H_custom_j}}

External parties contacted? {{.H_custom_k}}

Remediation steps taken: None

 

It may confuse the recipients when they see things like h_custom_k

I guess I could address this by branching the business process and having two templates but its extra work and complication just to address Null values.

 

Regards,

Will.

Link to comment
Share on other sites

Hi @Will J Douglas

Yes there is a modifier that can be added to variables to control whether or not the variable should show based on whether a value is present. 

To do this, the format is: {{.variable|empty}} - so in your example it would be {{.H_custom_j|empty}}
This means that if h_custom_j does NOT contatin a value, this whole string will not be present in the resolved template.

For more information we have a wiki page that gives some details about this: https://wiki.hornbill.com/index.php/Email_Templates

Hope this helps!

Kind Regards

Bob

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