Project

General

Profile

Patch #2406 » redmine-1.0.1-mail_from_pattern.patch

Patch for mail_from pattern - Daniel M, 2010-09-07 20:41

View differences:

./app/models/mailer.rb 2010-09-04 19:56:32.000000000 +0200
'Issue-Id' => issue.id,
'Issue-Author' => issue.author.login
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", issue.project.identifier) unless Setting.mail_from_pattern.to_s.empty?
message_id issue
recipients issue.recipients
cc(issue.watcher_recipients - @recipients)
......
'Issue-Id' => issue.id,
'Issue-Author' => issue.author.login
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", issue.project.identifier) unless Setting.mail_from_pattern.to_s.empty?
message_id journal
references issue
@author = journal.user
......
# Mailer.deliver_document_added(document) => sends an email to the document's project recipients
def document_added(document)
redmine_headers 'Project' => document.project.identifier
from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", document.project.identifier) unless Setting.mail_from_pattern.to_s.empty?
recipients document.recipients
subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
body :document => document,
......
recipients container.recipients
end
redmine_headers 'Project' => container.project.identifier
from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", container.project.identifier) unless Setting.mail_from_pattern.to_s.empty?
subject "[#{container.project.name}] #{l(:label_attachment_new)}"
body :attachments => attachments,
:added_to => added_to,
......
# Mailer.deliver_news_added(news) => sends an email to the news' project recipients
def news_added(news)
redmine_headers 'Project' => news.project.identifier
from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", news.project.identifier) unless Setting.mail_from_pattern.to_s.empty?
message_id news
recipients news.recipients
subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
......
def message_posted(message)
redmine_headers 'Project' => message.project.identifier,
'Topic-Id' => (message.parent_id || message.id)
from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", message.project.identifier) unless Setting.mail_from_pattern.to_s.empty?
message_id message
references message.parent unless message.parent.nil?
recipients(message.recipients)
......
def wiki_content_added(wiki_content)
redmine_headers 'Project' => wiki_content.project.identifier,
'Wiki-Page-Id' => wiki_content.page.id
from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", wiki_content.project.identifier) unless Setting.mail_from_pattern.to_s.empty?
message_id wiki_content
recipients wiki_content.recipients
cc(wiki_content.page.wiki.watcher_recipients - recipients)
......
def wiki_content_updated(wiki_content)
redmine_headers 'Project' => wiki_content.project.identifier,
'Wiki-Page-Id' => wiki_content.page.id
from Setting.mail_from_pattern.to_s.gsub("%%projectid%%", wiki_content.project.identifier) unless Setting.mail_from_pattern.to_s.empty?
message_id wiki_content
recipients wiki_content.recipients
cc(wiki_content.page.wiki.watcher_recipients + wiki_content.page.watcher_recipients - recipients)
./app/views/settings/_notifications.rhtml 2010-09-04 19:43:33.000000000 +0200
<div class="box tabular settings">
<p><%= setting_text_field :mail_from, :size => 60 %></p>
<p><%= setting_text_field :mail_from_pattern, :size => 60 %></p>
<p><%= setting_check_box :bcc_recipients %></p>
<p><%= setting_check_box :plain_text_mail %></p>
./config/locales/en.yml 2010-09-04 19:45:46.000000000 +0200
setting_attachment_max_size: Attachment max. size
setting_issues_export_limit: Issues export limit
setting_mail_from: Emission email address
setting_mail_from_pattern: Emission email address pattern
setting_bcc_recipients: Blind carbon copy recipients (bcc)
setting_plain_text_mail: Plain text mail (no HTML)
setting_host_name: Host name and path
./config/settings.yml 2010-09-04 19:55:23.000000000 +0200
default: '25,50,100'
mail_from:
default: redmine@example.net
# pattern for From address
# - can replace '%%projectid%%' with project ID
# ex: %%projectid%%-support@example.net"
mail_from_pattern:
default: ""
bcc_recipients:
default: 1
plain_text_mail:
(2-2/2)