IF statement within an external email file

Post Reply
User avatar
gabrielp
Advanced member
Posts: 577
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

IF statement within an external email file

Post by gabrielp »

Hi guys,

I have an email with an external HTML file I'm using in a Switch flow. I'd like to say, IF comments is not blank, then include this block.



Can this be done?



All I can think of is routing to another email configurator if the comments is equal to "" and then send all others to the other configurator. But that involves having two email files: one with comments and one without.
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

IF statement within an external email file

Post by freddyp »

The comments must come from some variable. Variables that are empty will generate an empty string and hence will not be there.



One method you can use to generate different types of content is to use two folders to which you add something in "Attach email body text". In the mail template you put [Job.EmailBody] and depending on the route taken by the job you get a different text.



Note that when you "Attach email body text" multiple times it is not destructive, you keep adding text.



Freddy
Post Reply