Feature #40422 » 0001-Create-new-parameter-for-mail_hander.rb-insert_name_.patch
| app/models/mail_handler.rb | ||
|---|---|---|
| 46 | 46 |
options[:no_account_notice] = (options[:no_account_notice].to_s == '1') |
| 47 | 47 |
options[:no_notification] = (options[:no_notification].to_s == '1') |
| 48 | 48 |
options[:no_permission_check] = (options[:no_permission_check].to_s == '1') |
| 49 |
options[:insert_name_and_email_to_description] = (options[:insert_name_and_email_to_description].to_s == '1') |
|
| 49 | 50 | |
| 50 | 51 |
ActiveSupport::Notifications.instrument("receive.action_mailer") do |payload|
|
| 51 | 52 |
mail = Mail.new(raw_mail.b) |
| ... | ... | |
| 69 | 70 |
%w(project status tracker category priority assigned_to fixed_version).each do |option| |
| 70 | 71 |
options[:issue][option.to_sym] = env[option] if env[option] |
| 71 | 72 |
end |
| 72 |
%w(allow_override unknown_user no_permission_check no_account_notice no_notification default_group project_from_subaddress).each do |option| |
|
| 73 |
%w(allow_override unknown_user no_permission_check no_account_notice no_notification default_group project_from_subaddress insert_name_and_email_to_description).each do |option|
|
|
| 73 | 74 |
options[option.to_sym] = env[option] if env[option] |
| 74 | 75 |
end |
| 75 | 76 |
if env['private'] |
| ... | ... | |
| 213 | 214 |
issue.subject = "(#{ll(Setting.default_language, :text_no_subject)})"
|
| 214 | 215 |
end |
| 215 | 216 |
issue.description = cleaned_up_text_body |
| 217 |
name = email.header['from'].try(:addrs).to_a.first |
|
| 218 |
if handler_options[:insert_name_and_email_to_description] |
|
| 219 |
sender_email = email.from.to_a.first.to_s.strip |
|
| 220 |
issue.description = "<<<#{name.display_name};#{sender_email}>>>\n" + issue.description
|
|
| 221 |
end |
|
| 216 | 222 |
issue.start_date ||= User.current.today if Setting.default_issue_start_date_to_creation_date? |
| 217 | 223 |
if handler_options[:issue][:is_private] == '1' |
| 218 | 224 |
issue.is_private = true |