Merge pull request #604 from carlolars/603_WrongEmailWhenSendingDocuments

Fixing #603
This commit is contained in:
Karel Picman 2016-11-16 12:27:35 +01:00 committed by GitHub
commit bd389c1e55
3 changed files with 5 additions and 3 deletions

View File

@ -365,7 +365,8 @@ class DmsfController < ApplicationController
:zipped_content => zipped_content,
:folders => selected_folders,
: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'
rescue Exception

View File

@ -61,7 +61,7 @@ class DmsfMailer < Mailer
attachments['Documents.zip'] = { :content_type => 'application/zip', :content => zipped_content_data }
end
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
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[folders]', @email_params[:folders].to_json) %>
<%= hidden_field_tag('email[files]', @email_params[:files].to_json) %>
<%= hidden_field_tag('email[from]', @email_params[:from]) %>
<div class="box tabular">
<p>
<%= 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>
<%= label_tag('email[to]', l(:label_email_to)) %>