Send Email with dynamic content using API

Lopa1408
Level 3

Send Email with dynamic content using API

Hi,

We have a gaming app and API connects the app with Marketo. We need to set up trigger based email campaigns for different criteria using smart list as Requested Campaign Source = Web Service API and Flow as Send Email.

 

I have created dynamic email fields using lead tokens in the emails(and have added them to field management under admin). For example: s_clan_leaderboardinfo, s_clan_clanname. s_clan_season# etc.

 

I will be sharing the dynamic tokens with backend team and they said they will be running triggers based on my smart campaigns.

Please let me know if you have any idea/suggestions to follow here? Or if I can add anything else to improve my program.

 

Thanks.

 

6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: Send Email with dynamic content using API

{{lead.tokens}} aren't dynamic content. They're static values - mutable values to be sure, but they are permanent changes and only output one value for a lead at a given point in time.

 

"Dynamic" in Marketo-speak means that either the lead's segment (within a certain segmentation) switches content blocks automatically, or Velocity code is used to generate content based on any number of point-in-time characteristics, or that you're passing {{my.tokens}} as ephemeral content within a single API call. It doesn't sound like you're doing any of these, you're just setting a lead field.

 

I'm not sure what you're asking exactly. Is setting lead fields the best way to send ephemeral data? Not really, but it's not a tragically bad idea. Depends on your volume and how you're throttling requests to your app (which consume API calls in turn).

Lopa1408
Level 3

Re: Send Email with dynamic content using API

Let me give you one example of an email with dynamic field that I am working on. It looks like this:

 

Capture.PNG

 
 

we have to set up the email for different seasons(dynamic field) of Clan and different missions(dynamic field) of the game. Shall I use {{my.tokens}} here instead of the lead tokens?

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Send Email with dynamic content using API

Right now you're using static tokens. It isn't "dynamic" now, it's merely personalized. Let's not change established definitions as it makes it  harder to communicate.

 

I would advise using text {{my.tokens}} in this case and passing the values in the Request call.  

Phillip_Wild
Level 10

Re: Send Email with dynamic content using API

@SanfordWhiteman  would this be a use case for something like a JSON dump into a lead file? Each lead that qualifies for the email could have a field which looks something like this:

 

{"clan": "Blue Clan",
{"missions": {
"A": 
{"goal": "capture the flag",
"maxPartyMembers": 6},

"B": 

{"goal": "kills",

"maxPartyMembers": 4}

}}

(Code editor doesn't seem to format JSON well! Boo). 

 

Then you could use Velocity tokens to parse it out and get the info you need, and only use one API call per lead to update the information. Or, update in bulk via the Bulk API. 

 

I guess alternatively you could just update a "Clan" field for every member, and then update the large {{my.token}} at the email level with all the mission information?

SanfordWhiteman
Level 10 - Community Moderator

Re: Send Email with dynamic content using API

Definitely, Phillip. The JSON approach - and triggering on the Data Value Changes  - would be much more efficient. Note to ensure the data value does, indeed, change you'd add the current timestamp, or a GUID if it felt better, into the JSON.

Lopa1408
Level 3

Re: Send Email with dynamic content using API

As per your suggestion I have set up text {{my.tokens}} and used them in the email as below.

Capture.PNG