wpsharks / comment-mail

A WordPress plugin enabling email subscriptions for comments.
http://comment-mail.com
GNU General Public License v3.0
8 stars 3 forks source link

Feature Request: Option to disable comment clip in email notifications #281

Closed renzms closed 7 years ago

renzms commented 8 years ago

It would be nice to have the option to disable comment clipping in email notifications to show the full comment, i.e, using HTML in comments without it being converted to plain text and full content length.

Current Workaround

Currently, the only way to prevent a comment from being clipped/stripped of HTML in the comment notification email is to modify the Advanced Templates and remove the function that is clipping the comment.

Problem

This fix is only applicable for Pro users, but currently not an option for Lite users since Advanced Templates are only available in the Pro version.

Solution

Add an option for both Lite and Pro users to turn off automatic clipping in the menus.

jaswrks commented 8 years ago

Another +1 for this here in a private/internal ticket: https://websharks.zendesk.com/agent/tickets/13056

jaswrks commented 8 years ago

Quick Outline

There are two functions in Comment Mail that deal with clipping of the comment content body specifically, and therefore instead of going through each template file it might be easier just to filter these methods so that you can change this behavior easily.

So what is needed is a new configurable option, and then have these two methods look for that option and either do the clipping, or skip the clipping altogether.

jaswrks commented 7 years ago

It seems this is already possible. See attached screenshot.

2016-12-02_01-16-20

renzms commented 7 years ago

@jaswsinc

It seems this is already possible. See attached screenshot.

This feature needs to be added in the Lite version as well. :)

Problem This fix is only applicable for Pro users, but currently not an option for Lite users since Advanced Templates are only available in the Pro version.

screen shot 2016-12-02 at 11 04 37 pm

raamdev commented 7 years ago

@jaswsinc writes...

It seems this is already possible. See attached screenshot.

So how do we disable clipping in the email templates?

Oh... now I get it. You have to set the minimum lengths to very large numbers and the resulting effect is the same as not clipping...

However, the problem with this is that the content still runs through the clipping function, which destroys things like line breaks, so if you want multi-paragraph comments to show up as multi-paragraph comments in your email templates, setting the minimum clip lengths to a large number does not do it... we need to edit the templates and strip out that clipping method.

So, an option is still necessary here. We need something that allows a site owner to disable clipping, which should have the effect of stripping out the clip function from the email templates (e.g., have the clipping function check if clipping is disabled and simply return without doing anything).

jaswrks commented 7 years ago

I see. Great points all around. I'll add this in just a moment.

jaswrks commented 7 years ago

2016-12-03_00-27-04 2016-12-03_00-26-50

jaswrks commented 7 years ago

Next Release Changelog:

jaswrks commented 7 years ago

The following Simple template replacement codes are now deprecated:

The old replacement codes will continue to work, but since the behavior of these replacement codes is now dependent upon clipping being enabled or disabled by CM options, the name of these has changed along with the description they have in the UI.

jaswrks commented 7 years ago

@renzms If you can help me test this I'd appreciate it. I implemented the new logic and config. option, but I have not yet tested receiving email notifications since this change was made.

renzms commented 7 years ago

@jaswsinc @raamdev

Confirmed Working

Tested using Comment Mail v161210 Pro/Lite RC and WP 4.7.

Comments on front end

With Clipping screen shot 2016-12-13 at 5 24 33 pm Without Clipping

screen shot 2016-12-13 at 5 26 30 pm

Backend Clip Settings

With Clipping screen shot 2016-12-13 at 5 31 51 pm

Without Clipping screen shot 2016-12-13 at 5 31 44 pm

Email Notifications

With Clipping

screen shot 2016-12-13 at 5 26 46 pm

Without Clipping

screen shot 2016-12-13 at 5 26 57 pm

raamdev commented 7 years ago

Comment Mail v161213 has been released and includes changes from this GitHub Issue. See the v161213 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#281).