mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +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:
@ -50,8 +50,8 @@ end
|
||||
bot.update!(admin: true, moderator: false)
|
||||
|
||||
bot.user_option.update!(
|
||||
email_private_messages: false,
|
||||
email_direct: false
|
||||
email_messages_level: UserOption.email_level_types[:never],
|
||||
email_level: UserOption.email_level_types[:never]
|
||||
)
|
||||
|
||||
if !bot.user_profile.bio_raw
|
||||
|
@ -109,7 +109,7 @@ describe DiscourseNarrativeBot::TrackSelector do
|
||||
|
||||
it 'should not enqueue any user email' do
|
||||
NotificationEmailer.enable
|
||||
user.user_option.update!(email_always: true)
|
||||
user.user_option.update!(email_level: UserOption.email_level_types[:always])
|
||||
|
||||
post.update!(
|
||||
raw: 'show me what you can do',
|
||||
|
Reference in New Issue
Block a user