Dear developers/experts,

I found a bug (possibly) for the D7 version of Notifications.

When I creating a node, the email (HTML) I received is totally fine.

However, when I post a comment, the HTML email screwed up. It will display in the email the HTML tags, e.g., <p>TEST</p>.

When I tried to view the source of the emails I received, the new node one (correct displaying one) is: <p>TEST</p>
But the comment one (wrong displaying one) is &lt;p&gt;TEST&lt;/p&gt;

Seems somewhere need to use the function html_entity_decode for the comment email sending?

Any help or information will be highly appreciated!

Best,

Chao-Gan

Comments

ITra’s picture

Status: Active » Closed (fixed)

I kind of solved this bug, by simply:
ADD: $mail_body = decode_entities($mail_body);
In: messaging_htmlmail.inc Line 160:

Then the comment can send in the correct format also.

Best,

Chao-Gan

zeezhao’s picture

Issue summary: View changes
Status: Closed (fixed) » Active

Still seems an issue... I have seen something similar in some cases using Articles (filtered html) and their comments, subscribing to article.

However, when I use rules for notification for other content types (with organic groups), hmtl is fine.

Nafes’s picture

zeezhao, thanks. I am happy to see good active community on this module. We will fix all step by step. And will make a good 8.x version as well. Just don't expect it right now or tomorrow. First we need to fix immediate issues and after that to refactor Messaging and Notifications to D8 style with PSR-4 namespaces. Something similar like it has been done here.