mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 12:11:16 -05:00
Merge pull request #2420 from peternlewis/mailing_list_mode_disables_private_message_emails
Bugfix: Mailing list mode disables PM emails
This commit is contained in:
commit
1542854a93
1 changed files with 8 additions and 1 deletions
|
@ -100,7 +100,8 @@ class UserNotifications < ActionMailer::Base
|
||||||
opts[:allow_reply_by_email] = true
|
opts[:allow_reply_by_email] = true
|
||||||
|
|
||||||
# We use the 'user_posted' event when you are emailed a post in a PM.
|
# We use the 'user_posted' event when you are emailed a post in a PM.
|
||||||
opts[:notification_type] = 'posted'
|
# but it must get through to email in mailing list mode
|
||||||
|
opts[:notification_type] = 'postedprivate'
|
||||||
|
|
||||||
notification_email(user, opts)
|
notification_email(user, opts)
|
||||||
end
|
end
|
||||||
|
@ -156,6 +157,12 @@ class UserNotifications < ActionMailer::Base
|
||||||
return if user.mailing_list_mode && !@post.topic.private_message? &&
|
return if user.mailing_list_mode && !@post.topic.private_message? &&
|
||||||
["replied", "mentioned", "quoted", "posted"].include?(notification_type)
|
["replied", "mentioned", "quoted", "posted"].include?(notification_type)
|
||||||
|
|
||||||
|
# We use the 'user_posted' event when you are emailed a post in a PM.
|
||||||
|
# but it must get through to email in mailing list mode
|
||||||
|
if notification_type == 'postedprivate'
|
||||||
|
notification_type = 'posted'
|
||||||
|
end
|
||||||
|
|
||||||
title = @notification.data_hash[:topic_title]
|
title = @notification.data_hash[:topic_title]
|
||||||
allow_reply_by_email = opts[:allow_reply_by_email] unless user.suspended?
|
allow_reply_by_email = opts[:allow_reply_by_email] unless user.suspended?
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue