Bug Report from PaulBS #2021-6-22_12-17-11

OS info

  • Operating System : Mac OSX 20.5.0
  • Wappler Version : 3.9.9

Problem description

Creating an HTML email using HTML stored in a database by using “Set Value” steps.
However, when adding the various sections (HTML snippets) in the editor I select the format as HTML but it keeps reverting to Text so all the HTML code gets changed as escaped characters are added e.g.
div class="col num12"
becomes
div class=\"col num12\"
and spaces are removed etc.
If I change the editor back to HTML it displays correctly but when I save and leave, it gets reverted back to Text.

Steps to reproduce

  1. Add a Set Value step and check the Output box to test.

  2. Add some HTML code, edit the value (little pencil icon), select HTML (top right) and enter some HTML.

  3. Save the Server Data Content window.

  4. The Value appears correct in the properties window but when opening the API in the code editor, the HTML has been changed e.g.
    <div class="col num12"></div>
    becomes
    <div class=\"col num12\"></div>

  5. Run the API in Postman and the output of the Set Value appears with the escaped characters.

This breaks the final HTML output so it doesn’t display correctly.

Screenshot of Server Connect API with a simple Test Value:

The Server Data Connect editor window (with HTML type selected):


NOTE - if I go back into that screen after saving, Text type is displayed (not HTML)

The code behind that Test value:
CleanShot 2021-07-22 at 12.29.33

The Postman Output when running the API:

Can you please format your code as explained here: How to format code in your posts so that we can see what your code becomes - not clear from your post now.

Sorry Teodor, always forget that bit, now edited :slight_smile:

There’s nothing wrong with the text as such. It will render fine when used in say dmx-html on the client side.
The bug here is that its not remembering the “TYPE” of set value editor, so you have to do it manually to edit it in the UI.

Unfortunately, I am not using this as a source for the front end but as the content of an email.
I create a few global variables which hold the different parts of the final email which is an order confirmation (so has addresses and a list of items ordered).
The penultimate step is a single variable with all parts of the email (other variables) combined which is then used in a Send Mail step but the HTML it sends is corrupted so displays incorrectly.

Hi Sid,
You gave me an idea -
Instead of creating the email content in a variable and using that in the Send Mail step, I tried constructing the email in the Mail Body property of the Send Mail step, using the format as HTML and tried again, like this:

CleanShot 2021-07-22 at 14.15.43

And now when I inspect the sent email HTML, it is formatted correctly.

So my problem is solved, but the bug regarding not remembering the “TYPE” is still there but not so much of an issue

Thanks.