Conditionals in email template based on non-contact variable | Community
Skip to main content
Andrew_Holstei2
New Participant
June 18, 2021
Solved

Conditionals in email template based on non-contact variable

  • June 18, 2021
  • 3 replies
  • 3597 views

We are looking to allow marketers to choose from a drop down list of office locations for the footer of our email sends. I'd love to create a global list variable in the email template with the office locations, and then have the email template pick that up and populate the correct address. Is that possible? I'm not sure if I can use Velocity when the variable isn't on a contact or custom object record. Thanks in advance!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by PeterRy2

It sounds like snippets is what you're looking for. You can make a snippet for each office location, then your marketers can insert it into the email at the desired place. The snippet can contain the entire footer or part of it, depend on your setup.

3 replies

New Participant
June 20, 2021

To be clear @andrew_holstei2 , do you mean that the marketer should select the office, which will be the same info for all recipients? Or that the office information will vary based on the recipient's information?

 

If you mean the latter, the other answers have taken care of it. But if you mean the former, then there are a couple of ways:

1. Build it into different program templates so that when a marketer clones the template they are using, the right details are already populated.

2. The above, plus tokens: you could use {{my.tokens}} within a program to populate these, which would be copied over by the right template. Or, have one template which has tokens that are designed to be updated - either regular text tokens, or one email script token where the user modifies a line up the top to dictate the outcome. That would be a little open to user error though, so it depends to what extent you trust your marketers 🙂

 

However, if it's designed to be based on user fields then a snippet / Velocity script is definitely the way to go.

Andrew_Holstei2
New Participant
June 21, 2021

Thanks Phillip, the address would be the same for all recipients of the particular email, so a contact could see different office locations in different emails.

SanfordWhiteman
New Participant
June 18, 2021
Velocity can use anything it can see. With some tricks, you can get it to see a mktoVariable, but it's true that this isn't supported and it might be fragile if you're not very familiar w/VTL.
Andrew_Holstei2
New Participant
June 21, 2021

I'm only moderately familiar with Velocity so this may be more trouble than it's worth for me. Thanks for the help!

PeterRy2Accepted solution
New Participant
June 18, 2021

It sounds like snippets is what you're looking for. You can make a snippet for each office location, then your marketers can insert it into the email at the desired place. The snippet can contain the entire footer or part of it, depend on your setup.

SanfordWhiteman
New Participant
June 18, 2021

Not sure that quite works for the OP, Peter? If the idea is there's a list of offices only, this would be different as they'd have to Replace with Snippet and browse for the snippet.

 

But you're right, it's probably the easiest combination of usability + implementation as of now.