AnsweredAssumed Answered

Updating Emails via API with dynamic content

Question asked by c561a708385b9dc2a8a13907125fc72b135ee745 on May 31, 2016
Latest reply on Jun 1, 2016 by c561a708385b9dc2a8a13907125fc72b135ee745

The simple question is, how can I update an email through a token with another token or dynamic content piece, via the API.


The situation however is very different.


Quick breakdown:

Our CMS provides content to an email which we send every day. We must track each send separately, so we cannot use the same email each time.

We use tokens to supply much of the content, some structural HTML, and most importantly, the ads.


Our CMS decides either to fill the email with ads that we have sold directly and input into our CMS, or to use ads from a third party Ad Network. Our Ad Network requires a unique value for every email sent - A dynamic and unique URL for every email address, for every day, for every email - never repeating a single URL.

To create this we use can use a combination of three values, e=, li=, and p=. These values use tokens embedded into the email for example: e={{lead.Email Address}}, p={{}}{{}} to populate what ends up being a 100% unique url every send for every address.


Our Issue:

When the ads come from the Ad Network an extra "Ad Choices" type image and a logo must appear below the ad. These two items must have the same unique URL used for the ads. When the ads come from our CMS, they cannot have the Ad Network's logo, or their "Ad Choices" link.

We can get all the pieces working properly using a combination of tokens and logic in our CMS.


However, I cannot nest a token, like inside another token such.


So, when we supply an ad from the Network, we also populate the logo, and "Ad Choices" link. But the tokens that create the unique URL, do not work when passed into the email as part of another token. Say for instance, that all the ad content is supplied through a token called "AdContents," in it is the URL that has to be created dynamically. But because Marketo will not read a token supplied to it by another token, it does not properly construct the URL.


My Proposed Solution (thanks for bearing with me):

I think I can create a snippet containing the "AdChoice" and Logo links, along with working tokens. I believe that when trigger the email, I can also "Update Email Content In Editable Section", add the pre-prepped snippet, and then send the email.


Before I go to work on this - Does that sound logical? Is there another way? What about just editing the content section directly with the html needed, would a token be properly interpreted by Marketo if I supplied it to the email directly into an editable section, via API?




Sorry for the long post.