49 |
49 |
body :issue => issue,
|
50 |
50 |
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
|
51 |
51 |
render_multipart('issue_add', body)
|
|
52 |
|
|
53 |
issue.attachments.each do |attachment|
|
|
54 |
part :content_type => `file -ib #{attachment.diskfile}`.gsub(/\n/, ""),
|
|
55 |
:body => File.read(attachment.diskfile),
|
|
56 |
:disposition => 'attachment; filename=' + attachment.filename + ';',
|
|
57 |
:headers => { 'Content-Id' => attachment.filename },
|
|
58 |
:transfer_encoding => 'base64'
|
|
59 |
end
|
52 |
60 |
end
|
53 |
61 |
|
54 |
62 |
# Builds a tmail object used to email recipients of the edited issue.
|
... | ... | |
77 |
85 |
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
|
78 |
86 |
|
79 |
87 |
render_multipart('issue_edit', body)
|
|
88 |
|
|
89 |
journal.details.each do |detail|
|
|
90 |
if detail.property == 'attachment' && attachment = Attachment.find_by_id(detail.prop_key)
|
|
91 |
part :content_type => `file -ib #{attachment.diskfile}`.gsub(/\n/, ""),
|
|
92 |
:body => File.read(attachment.diskfile),
|
|
93 |
:disposition => 'attachment; filename=' + attachment.filename + ';',
|
|
94 |
:headers => { 'Content-Id' => attachment.filename },
|
|
95 |
:transfer_encoding => 'base64'
|
|
96 |
end
|
|
97 |
end
|
80 |
98 |
end
|
81 |
99 |
|
82 |
100 |
def reminder(user, issues, days)
|
... | ... | |
390 |
408 |
# https://rails.lighthouseapp.com/projects/8994/tickets/1799-actionmailer-doesnt-set-template_format-when-rendering-layouts
|
391 |
409 |
|
392 |
410 |
def render_multipart(method_name, body)
|
|
411 |
content_type "multipart/alternative"
|
|
412 |
|
393 |
413 |
if Setting.plain_text_mail?
|
394 |
|
content_type "text/plain"
|
395 |
|
body render(:file => "#{method_name}.text.plain.rhtml", :body => body, :layout => 'mailer.text.plain.erb')
|
|
414 |
part :content_type => "text/plain", :body => render(:file => "#{method_name}.text.plain.rhtml", :body => body, :layout => 'mailer.text.plain.erb')
|
396 |
415 |
else
|
397 |
|
content_type "multipart/alternative"
|
398 |
416 |
part :content_type => "text/plain", :body => render(:file => "#{method_name}.text.plain.rhtml", :body => body, :layout => 'mailer.text.plain.erb')
|
399 |
417 |
part :content_type => "text/html", :body => render_message("#{method_name}.text.html.rhtml", body)
|
400 |
418 |
end
|