mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FEATURE: add more granular user option levels for email notifications (#7143)
Migrates email user options to a new data structure, where `email_always`, `email_direct` and `email_private_messages` are replace by * `email_messages_level`, with options: `always`, `only_when_away` and `never` (defaults to `always`) * `email_level`, with options: `always`, `only_when_away` and `never` (defaults to `only_when_away`)
This commit is contained in:
@ -1154,8 +1154,8 @@ module Email
|
||||
|
||||
def enable_email_pm_setting(user)
|
||||
# ensure user PM emails are enabled (since user is posting via email)
|
||||
if !user.staged && !user.user_option.email_private_messages
|
||||
user.user_option.update!(email_private_messages: true)
|
||||
if !user.staged && user.user_option.email_messages_level == UserOption.email_level_types[:never]
|
||||
user.user_option.update!(email_messages_level: UserOption.email_level_types[:always])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user