Skip to main content
Solved

Can I use conditional logic in automation emails?

  • May 2, 2023
  • 1 reply
  • 177 views

Forum|alt.badge.img+1

I have an automation that generates an email.

In some cases the fields I want to include in the email are not set yet.

I want to add a conditional statement to the email composition, something like "If {name} is set, include {name} followed by a comma, otherwise skip straight to the text." I can't see a way to do this in the automations interface.

I know that I can add fields to the table to do this but I'm trying to figure out whether there is a way to handle this logic temporarily within the automation. 

 

Best answer by kuovonne

You can have conditional actions with different send email actions. However, I don't recommend this for small version differences. There is no way to include conditional logic directly in the message body of the automation configuration.

One technique that I use is to create the body of the email with a formula field. Then in the automation, I simply include the formula field as the body and not other text. This method works well.

Another technique is to use a system like my Email Table extension (with a premium license) that merges record data with a mustache template.

1 reply

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • Answer
  • May 2, 2023

You can have conditional actions with different send email actions. However, I don't recommend this for small version differences. There is no way to include conditional logic directly in the message body of the automation configuration.

One technique that I use is to create the body of the email with a formula field. Then in the automation, I simply include the formula field as the body and not other text. This method works well.

Another technique is to use a system like my Email Table extension (with a premium license) that merges record data with a mustache template.