SOLVED

How to use Salesforce Custom Objects in an Email

Go to solution
Anonymous
Not applicable

How to use Salesforce Custom Objects in an Email

I have created an email script token on the program and moved my emails under this program.

I have checked the Coupons Remaining object to allow the program/email to use the data.

The email script token currently reads:

#set($variable = ${Renewal_Notices__cList.get(0).Coupons_Remaining__c})

$variable

From what I read on the email scripting documentation, this is all that I need to do, but when I send myself a test "$variable" is the only thing that shows up.

Is there something I am missing?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: How to use Salesforce Custom Objects in an Email

You should send an actual email, not a sample. Make sure you're using a lead that that has this CO populated. Otherwise, you should expect to see just the name of the $variable, because that's the way Velocity reacts to a bad variable reference.

But more important, you can pre-test Velocity tokens without sending an email at all. In Preview, select a (static) list to use for per-lead preview:

pastedImage_1.png

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: How to use Salesforce Custom Objects in an Email

You should send an actual email, not a sample. Make sure you're using a lead that that has this CO populated. Otherwise, you should expect to see just the name of the $variable, because that's the way Velocity reacts to a bad variable reference.

But more important, you can pre-test Velocity tokens without sending an email at all. In Preview, select a (static) list to use for per-lead preview:

pastedImage_1.png

Anonymous
Not applicable

Re: How to use Salesforce Custom Objects in an Email

Great! Thanks!

SanfordWhiteman
Level 10 - Community Moderator

Re: How to use Salesforce Custom Objects in an Email

No prob. I forgot to mention that you should move the thread to Products​ (I usually say that before posting an answer!), "Community" is for website feedback, not support -- and yes, that's very confusing.