SOLVED

Updating Emails via API with dynamic content

Go to solution
Anonymous
Not applicable

Updating Emails via API with dynamic content

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={{campaign.id}}{{system.date}} 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 system.date 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?

Thanks,

Sorry for the long post.

1 ACCEPTED SOLUTION

Accepted Solutions
Grégoire_Miche2
Level 10

Re: Updating Emails via API with dynamic content

Hi Issa,

I gather you are using the Request Campaign » Marketo Developers ​API call, which enable to pass content as a token.

You may want to consider using Update Email Content In Editable Section » Marketo Developers instead. It will enable you to really edit the email from your CMS passing raw HMTL that may include the e={{lead.Email Address}}, p={{campaign.id}}{{system.date}} tokens.

-Greg

View solution in original post

2 REPLIES 2
Grégoire_Miche2
Level 10

Re: Updating Emails via API with dynamic content

Hi Issa,

I gather you are using the Request Campaign » Marketo Developers ​API call, which enable to pass content as a token.

You may want to consider using Update Email Content In Editable Section » Marketo Developers instead. It will enable you to really edit the email from your CMS passing raw HMTL that may include the e={{lead.Email Address}}, p={{campaign.id}}{{system.date}} tokens.

-Greg

Anonymous
Not applicable

Re: Updating Emails via API with dynamic content

Thanks again Gregoire.

This is what I was thinking of doing, and you confirmed it would work.

Best,

Issa