Email templates don't accept externally generated html

Suitecrm version = 7.11.2

I took a responsive email template (designed for use in all the marketing email systems) which has a lead-in of css.

No matter which editor I use in suitecrm (like tinymce using tools/sourcecode/paste) it won’t accept all the html - particularly it will not accept the css.

I spent a week editing this email and now it’s useless.

Is suitecrm just broken when it comes to html email?
I noticed there’s a 2016-originated github bug on this which was never resolved but is now marked closed.

The only way to get it working is by saving it directly in the database. And then you must make sure that nobody edits the template from within SuiteCRM or else it will get ruined.
To reduce (but not completely avoid) this risk you could create a custom module in which you enter your template and then, with a workflow (I am not sure if this would be possible) or a logic hook (this is definitely possible) you copy the raw html directly in the database. However you have to disable in some way editing of the template and, unfortunately (I think that), when you create a campaign SalesAgility have created a wizard whereas the template gets saved by SuiteCRM, so you should make sure that yu act after you create the campaign!

I have tried to convince SalesAgility to have at least the source code editor not to “purify” code (which should be rather easy to achieve but I had no success!

Wow, that’s a pretty gaping hole in usability.

So, essentially, a major CRM functionality (email campaigns), simply don’t work if one intends to produce output with a visual asthetic more recent than 2005.

Wow!

It is indeed a flaw. But you can definitely live with it.

I wouldn’t be so drastic! Even with this (and many other issues on which Sales Agility are continuously working hard to improve) SuiteCRM remains the top Open Source CRM in the market and one of the best overall, competing, and at times outperforming by far, with expensive commercial products!

So … there’s NO way to just use html/css with meta-tags in SuiteCRM emails for campaigns?

The code always gets stripped out?

I was hoping for a solution with SuiteCRM after leaving behind an old version of Sugar CE.

My team applies a patch to the built js code that enables more current html/css within the template tools.

In order to enable email editing to allow links/tables/etc we alter the last function declaration in modules/Emails/include/ComposeView/EmailsComposeView.js to add plugins and the correct buttons on the toolbar:

$.fn.EmailsComposeView.defaults = { “tinyMceOptions”: { skin_url: “themes/default/css”, skin: “”, plugins: [‘advlist autolink lists link image charmap print preview anchor textcolor’, ‘searchreplace visualblocks code fullscreen’, ‘insertdatetime media table contextmenu paste code wordcount fullscreen’], menubar: false, toolbar: [‘undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link table | removeformat’], formats: { bold: {inline: ‘b’}, italic: {inline: ‘i’}, underline: {inline: ‘u’} }, convert_urls:true, relative_urls:false, remove_script_host:false, } };

Lastly, to enable more current html and css we updated HTMLPurifier to 4.10 or higher and added an empty HTMLPurifier.autoload.php in include/HTMLPurfier directory

4 Likes

A thousand thanks.

@criterion9

How precisely did you updated?

Grabbed a zip of that library, moved the existing directory just in case. Then expanded the contents and created that empty file.