Email script tokens in campaigns triggered by an API

Not applicable

Email script tokens in campaigns triggered by an API


I have an email campaign that is triggered by a Web Service API:

The email contains a number of tokens, the values of which are set by the API. Because the values are set by the API, we were told by Marketo customer support that these tokens need to be Rich Text tokens. They are. And that part is working just fine.

However, I would like to add other tokens, whose values are NOT set by the API, to the same email. These tokens would need to be Email Script tokens, because I need to add some logic. I've tried a few tests and can't get any Email Script tokens to work. (I'm trying to insert an image based on the value of a database field)

Am I doing something wrong? Is this not even possible, since the campaign is being triggered by the API call? If it's not possible with tokens, is there another way I can accomplish what I'm trying to do? Any suggestions appreciated!

Level 10 - Community Moderator

Re: Email script tokens in campaigns triggered by an API

Please move the thread to Products​ to continue (Move link is at the right).

It's not true that you can't set Velocity tokens via the API.  What is true is that you can't pass temporary runtime Velocity tokens when calling the Request Campaign or Schedule Campaign methods. You have to change Velocity tokens permanently, i.e. you can set them before calling Request or Schedule.

Also, using preexisting Velocity tokens is not itself an issue. You'll have to provide far more detail about the output you're seeing in an API-sent email vs. that same email in standard batch or trigger mode, and your actual Velocity code.