Support Forum

HTML EMAIL Plugin – Post Content Not Appearing when Moderator on

RI Ricki
Ricki
Member

Hi,

I have HTML EMail Plugin installed.  It works great for forums where the posts are not being moderated.  The content is included.

However, for forums where the post is moderated.  The email that is sent out after the post is approved does not contain the Post Content.  The content is blank.  The title, author and link do show up.

Ricki

13 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Oh dear. We have not had that reported before. Can you tell me which email comes up empty? I.e., Subscription email…? Just so I know exactly what to test with…

RI Ricki
Ricki
Member

It is the subscription email.  The post content appears for posts not going through moderation, but it is empty if it has been  moderated/approved before it is sent out.

Thanks for looking into this.

YS Yellow Swordfish
Yellow Swordfish
Member

I have opened a bug report and it will be looked at ASAP. Thanks for the report and information.

RI Ricki
Ricki
Member

Is there any code I can change in the current plugin to fix this problem?  The bug tracker says it will be fixed in the new version, however, the board is anxious to have this resolved as the site is live.  They would like me to look into other forum solutions and I would like to avoid this if possible.

If I disable the HTML Email plugin, can I change the subscription plugin somehow to include the full forum post with formatting?

Thanks,

Ricki

YS Yellow Swordfish
Yellow Swordfish
Member

You will also have noticed then that this has not yet been investigated. But I can hurry that up. But you have confused things a little. Are you suggesting now that the problem actually lies in the Subscriptions plugin and not the HTML Emails plugin? You could save me spending time looking in the wrong place! If it is the Subscriptions plugin then I am rather surprised we have not heard of this issue before…

RI Ricki
Ricki
Member

A colleague suggested to me this morning to investigate a bit further.  I am testing out whether this lies in the Subscription plugin or the HTML Email plugin right now.  I setup a test site and am putting in the bare minimum of simple press plugins so I can troubleshoot better.

RI Ricki
Ricki
Member

I apologize.  This is a subscription plugin issue.  If you need a testing ground, you can use http://test.officeanimation.com.  I can PM you the admin user details.

Only subscription, admin bar plugins are installed.  I am able to recreate the issue.  General users must be moderated.  The content is not included in the email notification.

YS Yellow Swordfish
Yellow Swordfish
Member

Ok – that’s great – thanks for that. I will look there….

By the way – when this does get fixed all being well it wont necessarily mean having to wait until the next SP update. We tend to push out plugin fixes when sensible to do so and they only have to wait fpor a core release if there are dependencies – or – sometimes – a dependency on the next WordPress update.

YS Yellow Swordfish
Yellow Swordfish
Member

Wow – this looks pretty bizarre unless I am really missing something!

Are you able to edit code if I give details?

RI Ricki
Ricki
Member

Yes, I am able to edit the plugin files.  I create custom WordPress plugins and am very familiar with PHP.  I am not familiar with simple:press code with the exception of themes.

YS Yellow Swordfish
Yellow Swordfish
Member

Well it’s an odd one and I can’t imagine why it has not cropped up before. Bottom line is it seems that the post content is not even sent to the routine in question. But – I have not had an opportunity to actually try this fix…

File is wp-content/sp-resources/forum-plugins/subscriptions/library/sp-subscriptions-components.php.

Line 37 should be trhe sytart f the sql SELECT statement. As in:

'SELECT '.SFFORUMS.'.forum_id, forum_slug, '.SFTOPICS.'.topic_id, topic_slug, topic_name, '.SFPOSTS.'.post_id, '.SFPOSTS.'.user_id, post_status, post_index, guest_name

You need to add ‘post_content’; to the end of that column list as in:

'SELECT '.SFFORUMS.'.forum_id, forum_slug, '.SFTOPICS.'.topic_id, topic_slug, topic_name, '.SFPOSTS.'.post_id, '.SFPOSTS.'.user_id, post_status, post_index, guest_name, post_content 

Then, somewhere between lines 48 and 55 add the line:

$newpost['postcontent_unescaped'] = $postData->post_content;

Now to see if it works for you! And if it does note please that this is not a perfect or the final solution but it might just be good enough as a stop-gap until we can issue the proper  update. Please let me know…

RI Ricki
Ricki
Member

Thank you.  The code fixed the problem… including it not showing up with the HTML Email Plugin.

IK Ike
Ike
Member

Excellent, glad you have a fix until the update is released.