Mail handler: adds --no-notification option to disable notifications to the created user (#13341).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11526 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2013-03-03 08:57:00 +00:00
parent 6cffab9919
commit f77ed4a7c3
3 changed files with 21 additions and 1 deletions
+4
View File
@@ -39,6 +39,7 @@ class MailHandler < ActionMailer::Base
@@handler_options[:allow_override] << 'status' unless @@handler_options[:issue].has_key?(:status)
@@handler_options[:no_account_notice] = (@@handler_options[:no_account_notice].to_s == '1')
@@handler_options[:no_notification] = (@@handler_options[:no_notification].to_s == '1')
@@handler_options[:no_permission_check] = (@@handler_options[:no_permission_check].to_s == '1')
email.force_encoding('ASCII-8BIT') if email.respond_to?(:force_encoding)
@@ -455,6 +456,9 @@ class MailHandler < ActionMailer::Base
end
if addr.present?
user = self.class.new_user_from_attributes(addr, name)
if @@handler_options[:no_notification]
user.mail_notification = 'none'
end
if user.save
user
else