Re: Turn off token validations in Email Program Marketo

Anonymous
Not applicable

Turn off token validations in Email Program Marketo

Hi Kenny Elkington,

We are trying to validate sending transactional emails via RequestCampaign Marketo Rest API call.

Couple of Scenarios:

Scenario 1 :(Happy Path)

I have created a Email Program "A" with 2 tokens and using those in the email template associated to that program "A" using Marketo Sandbox UI and passing the values for those through the rest API call like

{
    "CampaignName": "Trial Alert",
    "Leads" : [
            {
               "id" : 599615
            }

​​

         ],
         "tokens" : [
            {
           
               "name": "{{my.other token}}",
               "value": "This is just a test"
            },
            {
               "name": "{{my.Footer Message}}",
               "value": "Yay Email sent"
            }
            ]
}

The above scenario works perfectly fine.

Scenario 2 :(Failure Path)

I am passing now 3 tokens instead of 2 tokens like above (3rd token doesn't exist at all), now the rest call returns an error code 1003 saying that "Invalid Token "Token 3" doesn't exist"

{
    "CampaignName": "Trial Alert",
    "Leads" : [
            {
               "id" : 599615
            }
         ],
         "tokens" : [
            {
           
               "name": "{{my.other token}}",
               "value": "This is just a test"
            },
            {
               "name": "{{my.Footer Message}}",
               "value": "Yay Email sent"
            },
            {
                 "name": "{{my.

​Token3

}}",
               "value": "

​Bad

Email

​not ​

sent"
            }
           
            ]
}

​So, my question is, Is there a way to turn off Validating for tokens to check if they exist or not?

our expectation is "please replace the token value if token exists else ignore the token..not throw an error".

Please do let us know if there is a way to turn the validation off.

Tags (1)
1 REPLY 1
Kenny_Elkington
Marketo Employee

Re: Turn off token validations in Email Program Marketo

There is no way to disable this validation.  You can have the parent program have a token with that key, however, even if it is not used locally in the campaign.  This would permit success in your failure path.