I'm trying to use the Call Web Service action in combination with Zapier webhooks to send email using the Mandrill transactional email service. Everything is working except that the email message body, which the user can adjust in an HTML control on the Method screen, is being included in the JSON payload with carriage returns included, and Zapier can't interpret the payload correctly with them included. Is there some way I can force these to be stripped before sending the webhook? I was able to find info on the forums about how to replace newlines in Method Classic, but we've only been using Method for about 9 months and only use the new version of the site.
I am already copying the email message body from the HTML control where it's created/edited to a second plain text field and escaping any double quotes and backspaces that may exist, but that doesn't remove the carriage returns.
I've used Webhook.site to inspect the actual JSON payload being sent, here's an example:
{ "subject": "Sample Subject Line", "body": "<p>Hello Name,</p>
<p>Email body introduction.</p>
<p>Here are the details:</p>
<ul>
<li>point 1</li>
<li>point 2</li>
<li>point 3</li>
</ul>
<p>Final Information goes here</p>
<p>Thank You, </p>
<p>Sender Name/Signature</p>", "sender_name": "Shannon Henry", "sender_email": "shannon@h***.com", "reply_to": "c***@h***.com", "JobID": "****", "recip_email": "shannon@h***.com", "check_param": "........."}
If I take the payload from webhooks.site and remove the carriage returns from the "body" section, so it all shows on a single line, then paste that into the payload space in the Call Web Service - Test Environment, the automation triggers perfectly. But with the extra carriage returns in place I get a succcess message from Zapier but the automation does not actually trigger, as the service is unable to accurately parse the payload.