Re: Email script tokens populate in preview mode, but not in production (email send + sample send)!

Anonymous
Not applicable

Email script tokens populate in preview mode, but not in production (email send + sample send)!

I use email script tokens to access custom object data and inject it into the email.

I can confirm:

  • The leads have populated custom objects associated with them.
  • The used fields are checked in the email script window tree.
  • The tokens populate correctly in preview mode, but not when I send a sample or test email.

Here's a screenshot of the email script: https://prnt.sc/k5atlm

Here's how I'm using it in my HTML: <a href="{{my.Offer Link}}">Test</a>

I've been using this method for months without any issues.

Even more odd, all of my previous campaigns that used this method no longer work either!

Can anyone help me out? Thanks a million.

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Email script tokens populate in preview mode, but not in production (email send + sample send)!

Samples can't be used to test Velocity that references COs -- so no surprise there.

You should be outputting entire <a> tags (including closing </a> and inner content) from VTL, not just an href, to ensure the link is tracked (that's the only supported way).

However, neither of the above would make a real email (non-sample) fail to query the CO list, if indeed the lead has records in the list.

Since you should wrap the the list reference in an empty check anyway (see https://blog.teknkl.com/script-editor-array-get-index/​) why don't you add output for empty/non-empty list and then post the exact results?

Anonymous
Not applicable

Re: Email script tokens populate in preview mode, but not in production (email send + sample send)!

I would if I knew how to do that. I'm a novice at email scripting, and have been relying on Marketo's default scripts.

Would doing as you suggest resolve my issue?

SanfordWhiteman
Level 10 - Community Moderator

Re: Email script tokens populate in preview mode, but not in production (email send + sample send)!

Sample code for isEmpty() is in my blog post, should be simple to translate for your list name.

Would doing as you suggest resolve my issue?

It will allow us to diagnose your issue, since you didn't describe what was actually happening at the technical level, only that something wasn't happening.

Any reference to a list should be wrapped in isEmpty() as a matter of course, otherwise you will get Velocity errors (including errors that stop emails from being approved).