{{system.unsubscribeLink}} Not Resolving Inside Dynamic Token Content Sent via Smart Campaign API | Community
Skip to main content
Level 2
February 20, 2026
Solved

{{system.unsubscribeLink}} Not Resolving Inside Dynamic Token Content Sent via Smart Campaign API

  • February 20, 2026
  • 1 reply
  • 39 views

Hi Marketo Community,

We are triggering Smart Campaigns via the Marketo API and sending dynamic HTML/RTF content through tokens.

Our dynamic token content includes the standard Marketo system unsubscribe token:

{{system.unsubscribeLink}}

However, when the email is delivered, this token does not get resolved and shows up as raw text instead of being replaced with the actual Marketo unsubscribe URL.

Use Case

  • We generate a lot of HTML content on our side

  • The content already contains our own unsubscribe link

  • We want Marketo to reliably replace it with the correct Marketo unsubscribe URL at send time

  • Since content is dynamic, we inject different HTML blocks via tokens

Problem

It seems Marketo does not support nested token resolution (system tokens inside other token values).

Question

Is there any supported way to:

  • Insert or replace a custom variable in our token content with {{system.unsubscribeLink}}

  • Force Marketo to resolve system tokens inside injected token-based HTML

  • Or handle unsubscribe links correctly when sending dynamic content via API?

Any guidance or best practices would be really appreciated.

Thanks!

Best answer by SanfordWhiteman

Nothing to do with system tokens in particular, this applies to all tokens.

 

The only* token context that can use fields from other contexts — not other “tokens” per se as that would be the wrong term — is Velocity.

 

Only an explicit Email Script {{my.token}} supports full Velocity, but in reality a Text {{my.token}} is also parsed as VTL.

 

So if you set up a Velocity variable that’s equivalent to {{system.unsubscribeLink}} (easy to build, the URL is a no-brainer) you can output the corresponding VTL ${reference}, say ${unsubLink}, in the runtime value you pass to the Request Campaign endpoint.

 

* other than Calendar tokens, a very special case 

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
February 20, 2026

Nothing to do with system tokens in particular, this applies to all tokens.

 

The only* token context that can use fields from other contexts — not other “tokens” per se as that would be the wrong term — is Velocity.

 

Only an explicit Email Script {{my.token}} supports full Velocity, but in reality a Text {{my.token}} is also parsed as VTL.

 

So if you set up a Velocity variable that’s equivalent to {{system.unsubscribeLink}} (easy to build, the URL is a no-brainer) you can output the corresponding VTL ${reference}, say ${unsubLink}, in the runtime value you pass to the Request Campaign endpoint.

 

* other than Calendar tokens, a very special case 

Level 2
February 20, 2026

Thanks for giving time to it. I realize I should have explained the query more clearly, so I’m outlining the situation in a more structured way below:

  1. We have HTML content that includes the variable contact.unsubscribeUrl, which is defined by our system when creating the template on our system side. We have control over whether this variable is resolved or not.

  2. Since Marketo does not support upserting email headers when triggering via the Smart Campaign API, we need to rely on Marketo’s one-click unsubscribe link.

  3. If we are using Marketo’s one-click unsubscribe link, then any unsubscribe URL present in the email body must also point to Marketo’s unsubscribe link.

  4. Currently, the complete email body is passed inside a token (for example, {{my.bodyContent}}). This content includes the contact.unsubscribeUrl variable. At the moment, we are not resolving this variable to our own unsubscribe link as we agreed not to use our unsubscribe url. 

  5. Because contact.unsubscribeUrl exists inside the {{my.bodyContent}} token, we now need it to resolve to Marketo’s unsubscribe link instead.

So the core question is:
How can we replace contact.unsubscribeUrl with Marketo’s unsubscribe link when the content is injected through the token?

I would really appreciate it if you could take a look at this specific scenario and advise on the best approach.

Thanks in advance.

SanfordWhiteman
Level 10
February 20, 2026

That does seem different from the original problem! Though it’s at least adjacent.

 

How (please be exact) does your HTML include this variable? Mustache syntax? Something else? Is it flexible? (Considering it isn’t interpolated on your side, can’t see why it would need to have a specific syntax.)