Mailer.mail does not use :from but 'From' as the key for the from-address. #603

The from field is set to "Username <Usermail>".
This commit is contained in:
Redmine User 2016-11-15 18:28:52 +01:00
parent 02c65e87aa
commit 84a878d2a5
3 changed files with 5 additions and 3 deletions

View File

@ -365,7 +365,8 @@ class DmsfController < ApplicationController
:zipped_content => zipped_content, :zipped_content => zipped_content,
:folders => selected_folders, :folders => selected_folders,
:files => selected_files, :files => selected_files,
:subject => "#{@project.name} #{l(:label_dmsf_file_plural).downcase}" :subject => "#{@project.name} #{l(:label_dmsf_file_plural).downcase}",
:from => "#{User.current.name} <#{User.current.mail}>"
} }
render :action => 'email_entries' render :action => 'email_entries'
rescue Exception rescue Exception

View File

@ -61,7 +61,7 @@ class DmsfMailer < Mailer
attachments['Documents.zip'] = { :content_type => 'application/zip', :content => zipped_content_data } attachments['Documents.zip'] = { :content_type => 'application/zip', :content => zipped_content_data }
end end
mail :to => email_params[:to], :cc => email_params[:cc], mail :to => email_params[:to], :cc => email_params[:cc],
:subject => email_params[:subject], :from => user.mail :subject => email_params[:subject], 'From' => email_params[:from]
end end
def workflow_notification(user, workflow, revision, subject_id, text1_id, text2_id, notice = nil) def workflow_notification(user, workflow, revision, subject_id, text1_id, text2_id, notice = nil)

View File

@ -32,10 +32,11 @@
<%= hidden_field_tag('email[zipped_content]', @email_params[:zipped_content]) %> <%= hidden_field_tag('email[zipped_content]', @email_params[:zipped_content]) %>
<%= hidden_field_tag('email[folders]', @email_params[:folders].to_json) %> <%= hidden_field_tag('email[folders]', @email_params[:folders].to_json) %>
<%= hidden_field_tag('email[files]', @email_params[:files].to_json) %> <%= hidden_field_tag('email[files]', @email_params[:files].to_json) %>
<%= hidden_field_tag('email[from]', @email_params[:from]) %>
<div class="box tabular"> <div class="box tabular">
<p> <p>
<%= label_tag('', l(:label_email_from)) %> <%= label_tag('', l(:label_email_from)) %>
<%= text_field_tag('email[from]', h(Setting.mail_from), :style => 'width: 90%;', :disabled => true) %> <%= text_field_tag('email[from_disabled]', @email_params[:from], :style => 'width: 90%;', :disabled => true) %>
</p> </p>
<p> <p>
<%= label_tag('email[to]', l(:label_email_to)) %> <%= label_tag('email[to]', l(:label_email_to)) %>