Are you sending html mail? It would be worth checking the value sent doesn’t contain un-escaped double quotes, that messes with the JSON body, or html characters that mess with the html layout.
Ok. It looks like there is more to it and I don’t think it is the API route which is causing it.
I tried sending an email directly from Bubble using the option “Send Email” from the workflow.
I populated the Body field with my data from the DB like so:
And surprise surprise my Inbox does not contain any email. Nothing in my spam folder as well.
Next I removed the reference to the DB table and only the typed text remained. Like so.
I receive this email!
My DB with the table that I am calling does contain values as shown below.
So seems like Bubble doesn’t like sending an email that contains text data from a table.
On a side note I also found that MailJet transactional templates hate multiline text.
I therefore had to remove line breaks using :find & replace regex string -
What you need to do (this post is very old and not accurate for the actual solution) is to use :formatted as JSON-safe on your rich text. Keep in mind that this add double quotes around your string so you must remove that from API Connector.
Ex:
You have "body":"<body>" should now be "body":<body>
Thanks a lot @Jici ! That was a big part of the problem. Good learning for me.
But there is still no way to send to MAILJET API a text with line breaks. With JSON-safe, I guess that all the line break are deleted…
No, the line break are replaced with /n that are the safe encoding in JSON for line breaks. This should work normally but maybe mailjet have a special encoding for linebreak. Check documentation.
That works ! Effectively I saw that I need to send <br> for line breaks. So I ended up adding a find and replace /n by <br> after the safe encoding in JSON, taking care to not add " " around the variable. And the line breaks are well interpreted in the email.
So the problem is fully solved now.
Thanks again Jici !