Custom action with sendgrid API: how do I parse multiline text?


I am trying to use the custom action to send a POST via JSON to the sendgrid API.
The issue here is - when I send single-line text, it works fine, but when I send multi-line text, it doesn’t send an email.
I basically guess this is because multi-line text cannot be parsed to a JSON string variable.
Please let me know how I should solve this problem.
Let me attach some screenshots.

Here is the form submit screen.

And here is the custom action that’s triggered when I click send.

And here is what JSON looks like for sendgrid.

I hope these explain the situation and when I type single-lined text in the message area, it works fine and sends out an email, but the issue is with multi-lined texts.

Please let me know how I should resolve this issue. Thank you in advance!


What error message do you receive from the sendgrid API in response when using multiline?

Thank you for your reply @Colin,

How do I find the error message? When setting up an API in the custom action, the test was successful and I cannot put multiline text in the JSON body, so I couldn’t send a request with multiline text there.

In actual app, if I put the multiline text, it doesn’t send an email and I was not sure how I can troubleshoot the sendgrid response in Adalo.

Thank you!

(* Sorry if this reply is late, I wasn’t expecting anyone would respond after 5 days of no-reply since its post, and thank you for your contribution. Please expect a prompt reply from now.)

I think the easiest way to use Sendgrid to do this is to create a transactional email template with the placeholders for dynamic data (or “handlebars” as Sendgrid calls it). Then reference the template ID in your API call and pass any dynamic “handlebars” you want like user’s name, location, personal message, etc. More here:

Thank you @pfordmedia,

I am actually parsing dynamic data to an email template by indicating the template id like you said.
The problem is that multiline texts won’t get through the JSON body of Adalo custom action and I think the request doesn’t seem to be sent to Sendgrid because of this JSON issue.

Please see this attached.

Could you please test this type of action on your end?

Thank you!

Hi, guys from the Adalo team,

Can I get a quick answer for my topic whether it’s a can-do or can’t-do, so I can report to my team and we take a further survey?


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.