diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index edbbe406b..c827f26f2 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -436,6 +436,7 @@ class MailHandler < ActionMailer::Base user.lastname = '-' if user.lastname.blank? user.language = Setting.default_language user.generate_password = true + user.mail_notification = 'only_my_events' unless user.valid? user.login = "user#{Redmine::Utils.random_hex(6)}" unless user.errors[:login].blank? diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index 2b5b3f070..b345683fe 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -768,6 +768,7 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal expected[0], user.login assert_equal expected[1], user.firstname assert_equal expected[2], user.lastname + assert_equal 'only_my_events', user.mail_notification end end