Feature #3760 » redmine3.1-3760.patch
| app/models/mail_handler.rb | ||
|---|---|---|
|
# add To and Cc as watchers before saving so the watchers can reply to Redmine
|
||
|
add_watchers(issue)
|
||
|
issue.save!
|
||
|
add_attachments(issue)
|
||
|
issue.save!
|
||
|
logger.info "MailHandler: issue ##{issue.id} created by #{user}" if logger
|
||
|
issue
|
||
|
end
|
||
| ... | ... | |
|
if email.attachments && email.attachments.any?
|
||
|
email.attachments.each do |attachment|
|
||
|
next unless accept_attachment?(attachment)
|
||
|
obj.attachments << Attachment.create(:container => obj,
|
||
|
obj.attachments << Attachment.create(
|
||
|
:file => attachment.decoded,
|
||
|
:filename => attachment.filename,
|
||
|
:author => user,
|
||
| app/models/mailer.rb | ||
|---|---|---|
|
@issue = issue
|
||
|
@users = to_users + cc_users
|
||
|
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue)
|
||
|
unless Setting.plain_text_mail?
|
||
|
issue.attachments.each do |attachment|
|
||
|
attachments[attachment.filename] = File.read(attachment.diskfile)
|
||
|
end
|
||
|
end
|
||
|
mail :to => to_users,
|
||
|
:cc => cc_users,
|
||
|
:subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
|
||
| ... | ... | |
|
@journal = journal
|
||
|
@journal_details = journal.visible_details(@users.first)
|
||
|
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => "change-#{journal.id}")
|
||
|
unless Setting.plain_text_mail?
|
||
|
journal.details.each do |detail|
|
||
|
if detail.property == 'attachment' && attachment = Attachment.find_by_id(detail.prop_key)
|
||
|
attachments[attachment.filename] = File.read(attachment.diskfile)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
mail :to => to_users,
|
||
|
:cc => cc_users,
|
||
|
:subject => s
|
||