Suitecrm: Access to core HTML for Emailtemplate existing and new

Created on 20 Sep 2016  路  25Comments  路  Source: salesagility/SuiteCRM

Issue

The latest version of SuiteCRM introduced a more plug and play approach to code when creating emails. It is really funky but for those of us long in the tooth with SugarCRM we have got used to building the HTML separately and pasting the whole lot into the template builder. Unfortunately the new area only allows you to put HTML inside the container so you don't have access to the core HTML. I've been speaking on a forum and a few others have come across this as a stumbling block. https://suitecrm.com/forum/installation-upgrade-help/10008-email-templates-html-editor

Expected Behavior

The edit source function should in reality allow you to edit all the HTML not just a container.

Actual Behavior

You can only edit the inside container HTML so if you create your email as standalone HTML you can't copy and paste it in and it works.

Possible Fix

We are getting around it at the moment by re-enabling the TinyMCE editor which gives the option to edit the true source. A suggestion might be to just allow the new HTML source editor to give you access to the true source not just a container.

Steps to Reproduce

1.
2.
3.
4.

Context

We have had to add a hack to make it work, it isn't pretty but without it old templates couldn't be reused and to build new ones would require retraining and redesigning our standard design template.

Your Environment

  • SuiteCRM Version used: 7.7.4
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Chrome 53.0.2785.116 m (64-bit)
  • Environment name and version (e.g. MySQL, PHP 7): PHP 5.9
  • Operating System and version (e.g Ubuntu 16.04): Ubuntu 14.04
Critical Fix Proposed Suggestion

Most helpful comment

@shogunpol The way you suggest used to work fine with the previous interface.
With the new interface this method no longer works on most circumstances.
There are two main problems:
. the cleaning takes place and ruins the code
. the html breaks (in most but not all cases) the SuiteCRM interface when you try to view in some way (edit or Detail views) the template.

Result: it's just crap. Unusable!

Solution create the template from within the new interface: too long to do it and it doesn't do what you are trying to achieve. For just a simple thing, if you want it the way yo want it and not the way it produces it, you have to spend hours and you will not get what you want: it is always different. Additionnally the selection of items is not precise so errors occur often and it is impossible to go back.

All 25 comments

I have raised this as a suggestion, this appears to be something which the new editor is limited with. we will investigate this and update shortly.

We have re-enabled the TinyMCE editor to make this work, but have noticed that when templates are first created and saved with our own HTML some kind of 'tidy' occurs where css inline styling gets applied to various elements but on subsequent saves (after deleting the unnecessary styling) this doesn't happen. Just wanted to note it because it is something to avoid if possible.

Also I do note this ticket has been marked as a 'suggestion', from my perspective and some others I have spoken to this is more of a functionality bug. It does seem an odd move to remove the source HTML editing option and am surprised there haven't been more issues from users. Am I missing something, do other people build their HTML emails from scratch in the editor each time? Or are people using third party programs for campaigning, which would be a shame because SuiteCRM has always been our campaigning tool.

This is a major issue for us also. With the editor butchering our HTML we can't use it to send out our Newsletter...

This is definitely a major issue and not just a suggestion.

In addition all the "tidying" should be set as an option instead of something that happens without the possibility to decide, specially on pasted or edited by hand html code.

This is definitely a major issue! This makes email template creation a BIG headache for us!

Same as above, the mosaic editor is awful. It would be amazing to have the option of turning it off and reverting to the previous WYSIWYG editor.

for us this is a major hindrance and should not be a suggestion. we end up pasting the html in the database to be able to send the newsletter.

Suggestion for everybody on this thread. Give a "+1" reaction on the top of the issue (on the initial text).

We have recently been told this is a good way to flag up an issue for developers' attention, since it allows listing issues sorted by reaction.

@virtualme123 , the way how we handle this in new releases is to make for users easier, however the functionality it works, just when you use "source code", all you need is to paste whole old template html code into, and should work. Confirm is this solve your issue.

No, the functionality isn't the same as with just having a WYSIWYG. For example the style tags are now stripped out (plus many other bits of random tidying)

@shogunpol I am not sure I understand when you say "all you need is to paste whole old template html code into, and should work".
My experience is that it doesn't work. Nothing else!
If you paste a full html template code this is what I get:
. the code gets "cleaned" and modified without having the possibility to tell the system not to do it
. since pasting applies only to a block and not the whole html, the resuling code is broken and it also breaks SuiteCRM when you try to view the template both in View mode or edit it in Edit mode.

As a result the paste HTML functionality is completely missing.

Currently we are pasting directly to the Database but we also have to instruct everybody not to enter edit mode because doing so breaks the template. The unfortunate thing is that, when you create a new campaign, the new wizard breaks the template and applies all the dirtying done by the "clean" automatic functionality that is not possible to disable.

I repeat this is a big BUG not a suggestion and it ruins all the remaining part of the CRM making it completely unusable for many!

@amariussi , when you open your template in source code mode just copy whole code, select source code from template menu and paste copied code, and should work.

@shogunpol The way you suggest used to work fine with the previous interface.
With the new interface this method no longer works on most circumstances.
There are two main problems:
. the cleaning takes place and ruins the code
. the html breaks (in most but not all cases) the SuiteCRM interface when you try to view in some way (edit or Detail views) the template.

Result: it's just crap. Unusable!

Solution create the template from within the new interface: too long to do it and it doesn't do what you are trying to achieve. For just a simple thing, if you want it the way yo want it and not the way it produces it, you have to spend hours and you will not get what you want: it is always different. Additionnally the selection of items is not precise so errors occur often and it is impossible to go back.

I absolutely agree with @pgorod @amariussi The email template doesn't work they way one wants it to be. Infact it feels like it has been degraded. With previous version one use to design the template he wants to and put the entire html in. With the new one, if you try doing it, it breaks, inline style gets lost.

Email templates are the customer facing thing, it has to be presented nicely. Not sure if the issue will be taken care or not. Currently i am managing via directly inserting the html into DB. But not quite happy with email templates

This is a major issue for us also. The email template doesn't work they way one wants it to be. Please change label suggestion to bug.

It is major issue on our installations also.
Mail template module is pracitcaly unusable.
Users are very angry :(

Hello,

If somebody is still interested.
Attached is patch for This problem which applies solutions menitioned in this and related threads.

Patch adds new button in DetailView menu for EmailTemplate, where one can select if he wants new style or old style editing of template.

Patch EmailTemplates-7.7.9_default_no_rwd.diff.gz is better, since default to old style and Duplicate action is working OK.
With patch EmailTemplates-7.7.9_default_rwd.diff.gz on Duplicate can not be used on old-style templates, since mozaik strips formating on load.

To Apply the patch:

  1. Make backup of modules/EmailTemplates
  2. Download the file
  3. cd modules/EmailTemplates (Wherever you have the instalation)
  4. gzip -cd EmailTemplates-7.7.9_default_no_rwd.diff.gz | patch -p1
  5. Clean browser cache
  6. test, test, test ...

I applied the patch on versions 7.79 and 7.6.10
EmailTemplates-7.7.9_default_no_rwd.diff.gz
EmailTemplates-7.7.9_default_rwd.diff.gz

Thanks @gody01 :) I'll help test next week!

Hey guys, we have provided a solution internally which we will review in the coming days https://github.com/salesagility/SuiteCRM/issues/2995. @gody01 we'll have a look at your supplied solution (do you have a PR?) and it would be get to get all the commenters feedback :)

If you mean pull request I just created it: #2998

Hello,
we made second attempt to fix the issue:
https://github.com/salesagility/SuiteCRM/pull/3092

In this case instead of changing php code on many places we created plug-in replacement for jquery.mosaic.js (called jquery.gosaic.js) which provides necessary environment and function but uses old-style tinyMCE.

Hi Everyone.

Still keeping this as a suggestion and on our roadmap we are planning of introducing the ability to choose your editor via user preferences. However for the mean time we have the simipler fix to allow you to add raw HTML.

Also @gody01 We will need to review your PR and see if we can progress it.

We have now set up a new home for suggestions at Trello. All github issues that were labeled 'suggestion' have been moved and will be closed. Certain ones will be progressed within the new Suggestion Box and may be re-opened.

Announcement of moving Suggestions:
https://suitecrm.com/forum/suggestion-box/13691-moving-suggestions-from-github-to

New SuiteCRM Suggestion Box
https://trello.com/b/Ht7LbMqw/suitecrm-suggestion-box

After more than 2 years, is there any solution to the original bug?

No, clearly not, the whole damn editor up to date is absolutely hideous. Why can't someone just create one that inserts \ tags, \

tags \ \, \
tidy inline css etc. Is it really that difficult? As per i'm seeing these issues closed off without adequate resolution, either that, or if it was fixed, as per, it becomes broken again in a later edition (I'm using 7.11.8).

Was this page helpful?
0 / 5 - 0 ratings