--- app/models/mail_handler.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100644 => 100755 app/models/mail_handler.rb diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb old mode 100644 new mode 100755 index 2cbc8a5c7..395572427 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -46,6 +46,7 @@ class MailHandler < ActionMailer::Base options[:no_account_notice] = (options[:no_account_notice].to_s == '1') options[:no_notification] = (options[:no_notification].to_s == '1') options[:no_permission_check] = (options[:no_permission_check].to_s == '1') + options[:insert_name_and_email_to_description] = (options[:insert_name_and_email_to_description].to_s == '1') ActiveSupport::Notifications.instrument("receive.action_mailer") do |payload| mail = Mail.new(raw_mail.b) @@ -69,7 +70,7 @@ class MailHandler < ActionMailer::Base %w(project status tracker category priority assigned_to fixed_version).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 no_notification default_group project_from_subaddress).each do |option| + %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| options[option.to_sym] = env[option] if env[option] end if env['private'] @@ -213,6 +214,11 @@ class MailHandler < ActionMailer::Base issue.subject = "(#{ll(Setting.default_language, :text_no_subject)})" end issue.description = cleaned_up_text_body + name = email.header['from'].try(:addrs).to_a.first + if handler_options[:insert_name_and_email_to_description] + sender_email = email.from.to_a.first.to_s.strip + issue.description = "<<<#{name.display_name};#{sender_email}>>>\n" + issue.description + end issue.start_date ||= User.current.today if Setting.default_issue_start_date_to_creation_date? if handler_options[:issue][:is_private] == '1' issue.is_private = true -- 2.41.0