Adds a method for extracting MailHandler options from ENV.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11785 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -46,6 +46,19 @@ class MailHandler < ActionMailer::Base
|
||||
super(email)
|
||||
end
|
||||
|
||||
# Extracts MailHandler options from environment variables
|
||||
# Use when receiving emails with rake tasks
|
||||
def self.extract_options_from_env(env)
|
||||
options = {:issue => {}}
|
||||
%w(project status tracker category priority).each do |option|
|
||||
options[:issue][option.to_sym] = env[option] if env[option]
|
||||
end
|
||||
%w(allow_override unknown_user no_permission_check no_account_notice default_group).each do |option|
|
||||
options[option.to_sym] = env[option] if env[option]
|
||||
end
|
||||
options
|
||||
end
|
||||
|
||||
def logger
|
||||
Rails.logger
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user