Add a Email Header setting. Useful for adding delimiters to every email.

#2852 #6628

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4362 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis 2010-11-02 19:00:36 +00:00
parent 0395eb99de
commit 7e359d3d7e
6 changed files with 26 additions and 0 deletions

View File

@ -25,6 +25,7 @@ hr {
</style>
</head>
<body>
<span class="header"><%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_header) %></span>
<%= yield %>
<hr />
<span class="footer"><%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer) %></span>

View File

@ -1,3 +1,4 @@
<%= Setting.emails_header %>
<%= yield %>
--
<%= Setting.emails_footer %>

View File

@ -21,6 +21,10 @@
<p><%= check_all_links('notified_events') %></p>
</fieldset>
<fieldset class="box"><legend><%= l(:setting_emails_header) %></legend>
<%= setting_text_area :emails_header, :label => false, :class => 'wiki-edit', :rows => 5 %>
</fieldset>
<fieldset class="box"><legend><%= l(:setting_emails_footer) %></legend>
<%= setting_text_area :emails_footer, :label => false, :class => 'wiki-edit', :rows => 5 %>
</fieldset>

View File

@ -325,6 +325,7 @@ en:
setting_issue_list_default_columns: Default columns displayed on the issue list
setting_repositories_encodings: Repositories encodings
setting_commit_logs_encoding: Commit messages encoding
setting_emails_header: Emails header
setting_emails_footer: Emails footer
setting_protocol: Protocol
setting_per_page_options: Objects per page options

View File

@ -186,3 +186,5 @@ rest_api_enabled:
default: 0
default_notification_option:
default: 'only_my_events'
emails_header:
default: ''

View File

@ -393,4 +393,21 @@ class MailerTest < ActiveSupport::TestCase
# should restore perform_deliveries
assert ActionMailer::Base.perform_deliveries
end
context "layout" do
should "include the emails_header" do
with_settings(:emails_header => "*Header content*") do
assert Mailer.deliver_test(User.find(1))
assert_select_email do
assert_select ".header" do
assert_select "strong", :text => "Header content"
end
end
end
end
end
end