Email Connector changes my html file

0
I have an HTML format I want to use for the email connector, but when I try to put it in the code block, it changes it to be much simpler and worse. How do I make it keep the HTML I want?My HTMLThe HTML after I save and reenter the code block editorThese are only the partial files but you get the idea. Large parts of the code are missing and reformatted.
asked
2 answers
0

I have the same issue.


On the SNIP_EmailTemplate_NewEdit snippet, you can manually add a new tab for "HTML Source"


And then have a text area that is set to the "Content" attribute of your template. This will allow you to put in your souce html. Tokens will still work as expected.


The simple rich text editor provided by default strips formatting for itself to work, so if you don't need that functionality, I'd remove its tab entirely so it doesn't accidentally format over your data again.


It's a change in the module, so just be concious that if you update the module you will need to re add this functionality.

answered
-1

Hi Thomas Urech

Haa! I can give a approach

1.Create an entity e.g., MyModule.EmailTemplateFile (generalize from System.FileDocument).

2.Build an admin page to upload the .html file (no editing inside Mendix).

3.At send time:

  • Read file content via CommunityCommons.StringFromFile or CommunityCommons.StringFromFileDocument (depending on your version).
  • Do token replacement (optional).
  • Send with Is HTML = true.



I hope this helps!!


answered