dokufreaks/plugin-blogtng

Author notification e-mail does not work as expected

Closed this issue · 3 comments

I noticed, that I (the author of a blog entry) only receive a notification on new comments, when I enable comment subscriptions.

I think that behavior is wrong.

File helper/comments.php:

Line 141: if($this->getConf('comments_subscription')) {
Line 145: // send subscriber and notify mails
Line 146: $this->send_subscriber_mails($comment);
Line 147: }

If the comments_subscription is set, then call send_subscriber_mails().
In this function the author is notified via email and right after that:

Line 220: // finish here when subscriptions disabled
Line 221: if(!$this->getConf('comments_subscription')) return;

Line 221 can never be false, as this was already checked in line 141 before calling.
The author is never notified, unless comment_subscription is enabled. After looking at the code, I think the original purpose was, that the author should be notified regardless of the comment_subscription value.

The solution could be, to exclude Line 146 from the if block and call it just afterwards.

That is correct. Could you send us a pull request so we can embed it?

Would be great.

Does it behave correctly when comment out this line? I encontered the same problem, and it seems that the optin option is not updated into the database or there are problems in the query at line 229 (for the sqlite3 branch)

Sorry that I didn't read the issue carefully. This is alreay fixed and my problem is due to another bug