sendMessage Question RE oddity

8 posts by 2 authors in: Forums > CMS Builder
Last Post: August 15, 2013   (RSS)

By Steve99 - July 31, 2013

Hello,

I've used this function many many many times over the years and it's fantastic. Even better as it progressed over the years and now coupled with Swift Mailer.

I just had a report from a client about a message displaying "weird" to them so I had them forward it to me. The message contents contained an ordered list with code wrapping the numbers:

<!--[if !supportLists]-->1.      
<!--[endif]-->

I've traced it back to a TinyMCE file (/3rdparty/tiny_mce/plugins/paste/editor_plugin.js).

On the front end of the site we're using the simple nicEdit.js to convert textarea's to simple rich text editors for this specific web form that is used internally. Given that we're not using TinyMCE here, I'm confused on why there would be an error tracing back to this file. Does the sendMessage function utilize parts of TinyMCE?

Thanks in advance.

Steve

By gregThomas - July 31, 2013

Hi Steve,

I just want to confirm I'm understanding this correctly before I suggest anything :) . So users are creating content in an textarea that is being converted to WYSIWYG editor using nicEdit.js in the front end of the site, and then this content is being e-mailed to your client using the sendMessage function. Is this data stored in CMS Builder at all? Could someone have edited the content in CMS Builder before the content is sent in an e-mail?

I've had a quick look around sendMessage function, it doesn't look as if it edits the contents of the HTML in anyway before sending. 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Steve99 - July 31, 2013

Hi Greg,

Yes, that is correct. No, the data is not stored in CMSB.

This simple "eBlast" form is used by a board member of a home owners association to send notifications to all residents (site utilizes the membership module - each resident has a profile). It consists of one text field for a subject line and one textarea for content that is using the most trimmed down instance of nicEdit.js.

I've also searched the database to see if they had possibly posted this message in the residents area of the site as well, but they did not (rules out entering it through TinyMCE WYSIWYG editor and copying into front end textarea for "eBlast").

As far as the sendMessage function is concerned, and as you verified, I wouldn't see why anything from TinyMCE would be referenced at all - especially since the specific file that conditional exists in has to do with handling pasting content.

So I guess with that being said, I'm left scratching my head  :)  Since the CMSB library is being loaded, do you think there might be a conflict between nicEdit and TinyMCE such as function names or something?

Thanks again, Greg.

Steve

Hi Steve,

Including the viewer functions on a page and using the sendMessage function won't call any of the tinyMCE code, you have to specifically call a couple of functions to get  tinyMCE to load. You could try using a regular expression to remove the comments from your html code before you send it:

$htmlCode = preg_replace('/<!--(.|\s)*?-->/', '', $htmlCode);

You could also try asking in the nicEdit forum and site to see if they have any suggestions.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Steve99 - August 1, 2013

Hi Greg,

Okay, thanks for the background info and suggestion.

Thanks again!

Steve

By Steve99 - August 12, 2013

Greg,

After further research it appears that this is related directly to Microsoft Word and Outlook. It just so happened to have the same name as used in TinyMCE. Also, it doesn't appear to happen every time and others have reported the same experience in various forums. Just thought I'd share this info.

Steve

Hi Steve,

Thanks for the feedback, I'll bear that in mind if the issue comes up again.

Cheers

Greg

Greg Thomas







PHP Programmer - interactivetools.com