I would like to create a mailing in a sending system via an API. I would like to transfer the html template via the “Content” variable.
I always get the error message “Please enter a valid JSON body”.
Attached you can find the code from the API.
How do I have to format the html so that it can be transferred?
To add to the above comment when sending HTML in JSON Your HTML within the JSON will need escaped out as per the attached link:
If you are using simple text within your HTML magic text within your JSON snippet above it will work fine. But when applying styles to your email HTML it will not work unless you escape your HTML.
I used several email providers and they will all throw the same problem if HTML is not escaped.
Example, I insert this JSON text with HTML in the subject of the mail when I press “DONE” automatically (I don’t know why) the system eliminates the syntax of the HTML:
TO: <p style=\"text-align: center;\"><span style=\"color: #0ac5cf; font-size: 18pt;\"><strong><span style=\"font-family: arial,helvetica,sans-serif;\">Benvenuto nella community</span></strong></p>
I noticed this error today, because I had already created the mail sending with JSON + HMTL and everything worked, then today I modified and I realized that adalo eliminated the syntax and this results in an error.
What happened? I tried to insert the JSON + HTML code also in an input field, but the same thing happened.
Why is it eliminated? I had personalized emails and now I can’t edit them anymore! <html><head></head><body>
As I understood, the problem is NOT with the being unable to insert JSON (like on the first post)?
In future, I would advise to consider creating a separate post for this as your case doesn’t relate to the original topic - this will help future readers to find information easier.
As for your question - if I understood correctly Adalo stripped off the opening and closing tags for and ? It is an interesting effect, didn’t know about it I tried this by myself - here are the results:
when I try to use < or > in configuring custom action in parameters (variables), it automatically replaces it with < and >
when I try to put or directly into the custom action parameters (Action → Custom Action), builder deletes these tags completely.
yes you understood correctly. TAGs are removed automatically. But before this was not the case in fact I had created a custom code to send emails and everything worked! now I am also wondering why they implemented this automatic REMOVAL!
@anon78309838 can you help us understand why? can you ask the team why they implemented this feature?
No news??? Nobody, and not even the Adalo team, knows why it is no longer possible to insert HTML code in the input fields or even in the custom actions?
This change was made for security reasons. We are certainly at fault here in not communicating this thoroughly and do understand that these changes may have impacted several use cases that our makers might have embedded in their apps.
We apologise for the inconvenience these unexpected changes may have impacted your app but we have not taken these actions without due cause.
@Colin thanks for the reply. however, I am no longer able to send personalized emails to my users upon registration. are you going to release other features on that? or is there another method to send personalized emails?
I’m not sure which type of email provider do you use, but in my experience with SendInBlue I managed to create quite extensive setup of personalised emails.
I did it via SendInBlue templates - all is set up there, and I pass only necessary parameters from Adalo (for example, recipient email, booking time - this is a booking app, booking status, etc.).
As for me such approach is more flexible: it takes much more effort to create HTML emails in Adalo, I prefer to use specialised service for this.
May be this could be helpful for your case as well.
I can confirm that is now broken. It is impossible to correctly insert variables into the HTML code of the JSON, because the editor moves around/removes HTML tags automatically.
@Victor - your tutorials were great and worked until Adalo broke this.
Just checked - Adalo removed HTML, HEAD, BODY tags. But tags like P remain. This is enough to send basic formatted letters.
And as I suggested above - if you’d like to send more complex emails, using templates is the best way to do this; it saves a lot of time and effort (and also allows to use mail tracking capabilities like mail open, deliveries, etc.).
Not sure how this is related to my tutorials though :))
Yes HTML formatting tags still remain, but it’s impossible to insert a variable inside that HTML content because the tags keep getting moved as you edit. That’s the problem!
The reference was to your password reset tutorial - Adalo tutorials: customised password reset
Do you have an example / article of how to use templates?
As you can see, there are no HTML, HEAD and BODY tags, but password reset messages are received successfully.
If you experience problem with custom action, I would advice to see if it works in a test mode and if you can see the messages on your email provider side.