I'm working in a Marketo instance with a custom object synced from SFDC. This is the first time I've gotten to work with custom objects. We want to send an email that includes a token for a field inside the custom object. I have just learned that I can create such a token with an email script token. Fun stuff! However, I can't use this unless I can test it first to make sure it will populate the way I intend. Short of creating an Account and Contact in SFDC with a populated custom object to be used for test purposes - can anyone think of way to preview the populated email without actually sending it? In other words, Contact "Samantha" has the custom object attached. I created an email script token referencing field xyx in the custom object. I want to be able to verify how my email script token populates if I send the email to Samantha. Is there any way to do that?
Thank you!
Denise
For the benefit of anyone looking for an answer to the same situation - how to preview how a token will render for a specific recipient (only with the added wrinkle that the token is an email script token):
1) Jamie Lewis's response is correct for normal tokens - but not for email script tokens:
"Yes, this is done in the preview pane then select the view by drop down and view by a specific lead or view by a list.
If you have a test lead in your database you can just pick that lead and the email preview will populate with the lead data.
The list will just be a list of test leads that you can scroll through to see the data change. This is great to make sure the personalization is working correctly. It has to be a static list though, can't be a smartlist."
2) Sanford and Rajesh are correct the email script tokens will not render (populate) in preview.
That clarifies it
I'll have to study this when my brain is fresh. Appreciate all the help!
In the meantime, my use case went away because each of the customers our email needs to target have multiple tail numbers and it's only a subset of them that apply. So I see no way to pull the right tail numbers out of the custom object. However, I'm interested in understanding how to use Email Script Tokens properly and get them to preview correctly in any case!
I may post my current dilemma to a new thread.
I'm confused. I think Jamie is correct in saying that if you select the "List" or "Lead" section of the email preview, the email is constructed and you can view the preview as you intend it. This is documented:
http://developers.marketo.com/documentation/velocity-script/
"You can also use the Email Preview to test your script. To do so, you must select View As: Lead Detail, and select a lead from an available static list. This has the added benefit of outputting any exceptions that may have occurred during script execution:"
I don't see View As: Lead Detail as an option. The only View As options I see are: Default, Lead, List.
By the way, what's the link to your post with the big pull quote?
I did try putting myself in a static list and using the email script token that Sanford created, which consisted of: ${lead.FirstName}
But it doesn't populate on preview.
I bet that is because you haven't got the checkbox selected for First Name in the email script editor.
You were right - but now it's checked and it makes no difference. Do I need to put something else in the email script token besides this?
${lead.FirstName}
@Sanford - I'm definitely using Email 2.0.
That should be fine. Output should be same as the regular {{lead.First Name}} token.
Since you're having trouble finding the Preview-as-Lead functionality, have you just sent an email (not a sample) to someone with a First Name?
I wasn't having trouble finding Preview-as-Lead - I couldn't find Preview-as-Lead-Detail (because it doesn't exist). At any rate, my test is working now! Woo-hoo! Now I can go to bed without fretting about this.
You guys are coding wizards and are inspiring me to want to learn!
It seems to be a typo in the documentation. It should be:
"You can also use the Email Preview to test your script. To do so, you must select View As: Lead Detail, and OR select a lead from an available static list. This has the added benefit of outputting any exceptions that may have occurred during script execution:"
Hi There - Just to close the loop on the instructions - Nicholas's correction is correct. The instructions as-written accurately describe how to preview tokens on a landing page (as opposed to an email).
Yes, I think you are correct about the documentation.
And guess what? My First Name Email Script Token is working now!!!! Yay!! I'm not sure what happened. My guess is that I forgot to save it after I fixed the check box.
I'm intrigued now! What do people commonly use email script tokens for? They only came up for me because of the custom object.
I use it for conditional content a lot using the IF/ELSE functionality.
ie,
IF product = xyz
print some info here...
ELSE product = abc
print something else here.
I generally find it's easier to do this than setup another segmentation. Campaign Monitor has a much more user friendly interface by the way, with inline conditional formatting but that's another story.
And as you mentioned, it is the only way to access the data in a custom object in an email.
I also have a script which corrects the first initial of a name to a capital, which I use with caution but which is generally useful nonetheless.
There are a few other examples on this community floating around, some of which I think are a bit naff but others which are very useful.
Denise Greenberg Nicholas Manojlovic this discussion spurred me to put up a blog post I've been wanting to do for a long time: http://blog.teknkl.com/hide-email-script-my-tokens-in-marketos-web-page-view/
oh my god.. I didn't know that..
That is definitely getting priority on the list. I am finding myself using email scripts a lot.
Welcome (again) to "Things only 2 people in the world know about."
If you don't see what Nicholas is seeing, and you're sure you're looking in the same part of the editor, maybe you should open a case.
He was referring to the documentation which backs up Jamie's original response.
NOTE: The original version of this response referred to Editor 2.0, but this works in Editor v1 as well -- for me at least.
The link you are referring to recommends testing with a sample email. I guess you cannot preview a script token.
Did you read the big pull quote in my post?