Feature #247 » mail_sender_project.patch
| app/models/mailer.rb (working copy) | ||
|---|---|---|
|
|
||
|
def issue_add(issue)
|
||
|
recipients issue.recipients
|
||
|
from issue.author.mail if issue.author
|
||
|
headers 'X-redmine-project' => issue.project.identifier
|
||
|
subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
|
||
|
body :issue => issue,
|
||
|
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
|
||
|
end
|
||
|
def issue_edit(journal)
|
||
|
from journal.user.mail if journal.user
|
||
|
issue = journal.journalized
|
||
|
headers 'X-redmine-project' => issue.project.identifier
|
||
|
recipients issue.recipients
|
||
|
# Watchers in cc
|
||
|
cc(issue.watcher_recipients - @recipients)
|
||
| ... | ... | |
|
end
|
||
|
|
||
|
def document_added(document)
|
||
|
headers 'X-redmine-project' => document.project.identifier
|
||
|
recipients document.project.recipients
|
||
|
subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
|
||
|
body :document => document,
|
||
| ... | ... | |
|
end
|
||
|
|
||
|
def attachments_added(attachments)
|
||
|
#from attachments.author.mail if attachments.author
|
||
|
container = attachments.first.container
|
||
|
added_to = ''
|
||
|
added_to_url = ''
|
||
| ... | ... | |
|
end
|
||
|
recipients container.project.recipients
|
||
|
subject "[#{container.project.name}] #{l(:label_attachment_new)}"
|
||
|
headers 'X-redmine-project' => container.project.identifier
|
||
|
body :attachments => attachments,
|
||
|
:added_to => added_to,
|
||
|
:added_to_url => added_to_url
|
||
|
end
|
||
|
def news_added(news)
|
||
|
from news.author.mail if news.author
|
||
|
headers 'X-redmine-project' => news.project.identifier
|
||
|
recipients news.project.recipients
|
||
|
subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
|
||
|
body :news => news,
|
||
| ... | ... | |
|
end
|
||
|
def message_posted(message, recipients)
|
||
|
from message.author.mail if message.author
|
||
|
headers 'X-redmine-project' => message.board.project.identifier
|
||
|
recipients(recipients)
|
||
|
subject "[#{message.board.project.name} - #{message.board.name}] #{message.subject}"
|
||
|
body :message => message,
|
||
| ... | ... | |
|
from Setting.mail_from
|
||
|
default_url_options[:host] = Setting.host_name
|
||
|
default_url_options[:protocol] = Setting.protocol
|
||
|
headers 'X-redmine-host' => Setting.host_name
|
||
|
end
|
||
|
|
||
|
# Overrides the create_mail method
|
||