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
Solved! Go to Solution.
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.
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.
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
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.
Thanks Sanford!
Will take a look at it .
Thanks,
Babu