SOLVED

Email address with & is not receiving an email from Marketo

Go to solution
Babu_Chikati
Level 3

Email address with & is not receiving an email from Marketo

Hi,

We are sending  sample emails via API (/rest/asset/v1/email/{id}/sendSample.json) to an email alias. Email alias has & in the alias name ex: my&email@test.com. For some reason sample is not delivered to the email alias which has &. Email is been delivered successfully to myemail@test.com

We suspect & in the email alias could be causing the issue. Is there any setting like "HTML Encode Tokens in Emails" to bypass the &

Passing below API payload 

{

     "emailAddress":"my&email@test.com"

    "leadId":"",

    "textOnly:false

}

 

Thanks for your help.

 

Thanks,

Babu

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Email address with & is not receiving an email from Marketo

You haven’t supplied a valid API payload for that endpoint.

 

The payload for Send Sample quite clearly needs to be x-www-form-urlencoded, not JSON. Naturally, that’ll URL-encode each parameter, taking care of the special & character.

 

Just tested and it works fine.

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Email address with & is not receiving an email from Marketo

You haven’t supplied a valid API payload for that endpoint.

 

The payload for Send Sample quite clearly needs to be x-www-form-urlencoded, not JSON. Naturally, that’ll URL-encode each parameter, taking care of the special & character.

 

Just tested and it works fine.

Babu_Chikati
Level 3

Re: Email address with & is not receiving an email from Marketo

Thanks Sanford!

I have already implemented following lines of code before calling API

var httpContent = new StringContent(json);
httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");

 

Please advise.

 

Thanks,

Babu

SanfordWhiteman
Level 10 - Community Moderator

Re: Email address with & is not receiving an email from Marketo

No idea what language or library that is. But obviously it’s not putting a proper URL-encoded body on the wire.

 

Unless the StringContent constructor automatically URL-encodes, it doesn’t look like you’re doing anything wrt encoding. Just adding the HTTP header doesn’t change a payload.

Babu_Chikati
Level 3

Re: Email address with & is not receiving an email from Marketo

Thanks Sanford!

Will take a look at it .

 

Thanks,

Babu