Email bodies with conditional content

Uncle Rob
Kilo Patron

So I have a legal team which has all kinds of conditional text they want to send depending on conditions of submission.

That is...

if you submit with X checked, include messagetext1 in email body

If you submit with Y checked, include messagetext2 in email body

If you submit with Z checked, include messagetext3 in email body

... and so on.

I want to handle this with one notification if I can.   I know I can call an email script to do all the logic evaluation, but its not a nice way to work with text (would prefer Rich HTML editor).   So my question is, can a mail   script call an email template that acts as a *component* of a body, rather than the entire email?

7 REPLIES 7

Hey Hackbro!



My nuclear option was simply building the email templates, then doing a gliderecord query out to each and pulling varname.message.   At the time I thought I might be crazy... but if you're thinking roughly the same thing, maybe there's hope for my confidence.


There's nothing crazy about data-driving stuff like this.   Think about all of the future content maintenance work you get to push to the users so you can work on data-driving the next thing.  



Give them update rights to the template fragment table and let them go nuts with all the inevitable content edits they're going to want to make.   And in this context, those fragments are totally user-data.   That's how the aforementioned contract system treated it too.


Going to be bare bones for right now.   This is a prototype for a team that's 1/5 of the stakeholders of an even larger prototype.   Bumping up against platform limitations everywhere.



rolling_dice.jpg