Summary:

Users may experience issues including complex HTML content in emails after upgrading to Sage CRM 7.3. This issue is caused by a new feature within the CKEditor WYSIWYG editor, which can be disabled.



Symptoms:

When creating complex email messages, many users will use an external HTML editor such as Dreamweaver to create the email body. The HTML for these emails can then be copied into Sage CRM email messages or templates using the Source button.

Customers may find that this process worked well in Sage CRM 7.2 or before, but on upgrading the Sage CRM 7.3, they may find that content is being stripped automatically from the HTML content. The most typical issue is that style tags and attrributes are removed, resulting in email messages using default fonts.



Cause:

Sage CRM 7.3 contains an upgraded WYSIWYG editor for creating HTML emails. CKEditor 4.4 contains a feature named the Advanced Content Filter which removes disallowed content from the HTML source of messages, whether it has been added by a user or an external plugin. The content removed may include disallowed tags, or styling information. This filter is intended to make it easier to create valid HTML which conforms to the styles set up within CKEditor; if these styles have not been added to the system, then the style information for the HTML may be lost.

 

Resolution:

The ACF can be disabled should a user wish to create complex HTML mailshots without adding extensive style customisations to CKEditor. This can be done by editing the config.js in the \CRM\WWWRoot\ckeditor\ directory. An additional line should be added, setting the allowedContent property to True. The modified contents of this file are given below:


CKEDITOR.editorConfig = function( config )
{
    config.toolbar = "Full";
    config.disableNativeSpellChecker = false;
    config.resize_enabled = false;
    config.fillEmptyBlocks = false;
    config.pasteFromWordRemoveFontStyles = false;
    config.pasteFromWordRemoveFontStyles = false;
    // config.extraAllowedContent = 'img(*){*}[*]';
    config.allowedContent = true;
    config.toolbar = [
    { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'Preview', 'Print','Templates'] },
    { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
    { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll'] },
    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
    { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
    { name: 'insert', items: [ 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak','Maximize'] },
    '/',
    { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl' ] },
    { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
    { name: 'colors', items: [ 'TextColor', 'BGColor' ] }
    ];
    config.fontSize_sizes = '8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt;22/22pt;24/24pt;26/26pt;28/28pt;36/36pt;48/48pt;72/72pt';
};

 

The eWare DLL loads in the content from config.js (rather than the client), so CRM will need to be restarted before these changes take effect. Clients will also need to clear their browser cache to avoid using outdated includes for the CKEditor.


More information:

Further information regarding the Advanced Content Filter is available here:

http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter