Project

General

Profile

Feature #3760 » redmine-3760-1.4.3.patch

Patch for sending email attachments on 1.4.3 - Brian Crowell, 2012-12-10 16:16

View differences:

app/models/mailer.rb
body :issue => issue,
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
render_multipart('issue_add', body)
unless Setting.plain_text_mail?
issue.attachments.each do |attachment|
part :content_type => `file -ib #{attachment.diskfile}`.gsub(/\n/, ""),
:body => File.read(attachment.diskfile),
:disposition => 'attachment; filename=' + attachment.filename + ';',
:headers => { 'Content-Id' => attachment.filename },
:transfer_encoding => 'base64'
end
end
end
# Builds a tmail object used to email recipients of the edited issue.
......
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => "change-#{journal.id}")
render_multipart('issue_edit', body)
unless Setting.plain_text_mail?
journal.details.each do |detail|
if detail.property == 'attachment' && attachment = Attachment.find_by_id(detail.prop_key)
part :content_type => `file -ib #{attachment.diskfile}`.gsub(/\n/, ""),
:body => File.read(attachment.diskfile),
:disposition => 'attachment; filename=' + attachment.filename + ';',
:headers => { 'Content-Id' => attachment.filename },
:transfer_encoding => 'base64'
end
end
end
end
def reminder(user, issues, days)
(3-3/6)