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

**URL:** <https://forum.adalo.com/t/custom-action-with-sendgrid-api-how-do-i-parse-multiline-text/5697>\
**Category:** Get Help\
**Created:** [November 6, 2020, 11:39pm UTC](https://forum.adalo.com/t/custom-action-with-sendgrid-api-how-do-i-parse-multiline-text/5697 "2020-11-06T23:39:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![v7sion](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@v7sion](https://forum.adalo.com/u/v7sion)\
**Post date:** [November 6, 2020, 11:39pm UTC](https://forum.adalo.com/t/custom-action-with-sendgrid-api-how-do-i-parse-multiline-text/5697/1 "2020-11-06T23:39:03Z")

</div>

Hi

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.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/7/7038a3edff86bbc5e1fb13c7a87dbbf330a4bdfd.png)

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

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/5/5c979d1c2edd0d2e1509ce523f86629225037eb9.png)

And here is what JSON looks like for sendgrid.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/c/cfe0652ebcb46be03cf74bbbd87e969b432aac48.png)

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!

Achan

---

<div class="post-metadata">

**Author:** ![anon78309838](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@anon78309838](https://forum.adalo.com/u/anon78309838)\
**Post date:** [November 11, 2020, 1:52pm UTC](https://forum.adalo.com/t/custom-action-with-sendgrid-api-how-do-i-parse-multiline-text/5697/2 "2020-11-11T13:52:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![v7sion](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@v7sion](https://forum.adalo.com/u/v7sion)\
**Post date:** [November 13, 2020, 6:51pm UTC](https://forum.adalo.com/t/custom-action-with-sendgrid-api-how-do-i-parse-multiline-text/5697/3 "2020-11-13T18:51:55Z")

</div>

Thank you for your reply @anon78309838,

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.)

---

<div class="post-metadata">

**Author:** ![pford](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/pford/32/4648_2.png) [@pford](https://forum.adalo.com/u/pford)\
**Post date:** [November 13, 2020, 7:03pm UTC](https://forum.adalo.com/t/custom-action-with-sendgrid-api-how-do-i-parse-multiline-text/5697/4 "2020-11-13T19:03:07Z")

</div>

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: [Mail Send | Twilio](https://sendgrid.api-docs.io/v3.0/mail-send)

---

<div class="post-metadata">

**Author:** ![v7sion](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@v7sion](https://forum.adalo.com/u/v7sion)\
**Post date:** [November 13, 2020, 7:39pm UTC](https://forum.adalo.com/t/custom-action-with-sendgrid-api-how-do-i-parse-multiline-text/5697/5 "2020-11-13T19:39:14Z")

</div>

Thank you @pford,

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.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/1/15d5f0fbc7d10389e244e87cefc9396ec621490c.png)

Please see this attached.

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

Thank you!

---

<div class="post-metadata">

**Author:** ![v7sion](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@v7sion](https://forum.adalo.com/u/v7sion)\
**Post date:** [November 19, 2020, 3:09am UTC](https://forum.adalo.com/t/custom-action-with-sendgrid-api-how-do-i-parse-multiline-text/5697/6 "2020-11-19T03:09:45Z")

</div>

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?

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [November 29, 2020, 3:09am UTC](https://forum.adalo.com/t/custom-action-with-sendgrid-api-how-do-i-parse-multiline-text/5697/7 "2020-11-29T03:09:47Z")

</div>

Closed on November 29, 2020, 3:09am UTC

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