Project

General

Profile

Patch #1382 » add_cc_notification.diff

Add global cc to notification - James Turnbull, 2008-06-05 09:27

View differences:

test/functional/settings_controller_test.rb (working copy)
def test_post_edit_notifications
post :edit, :settings => {:mail_from => 'functional@test.foo',
:mail_cc => 'functionalcc@test.foo',
:bcc_recipients => '0',
:notified_events => %w(issue_added issue_updated news_added),
:emails_footer => 'Test footer'
}
assert_redirected_to 'settings/edit'
assert_equal 'functional@test.foo', Setting.mail_from
assert_equal 'functionalcc@test.foo', Setting.mail_cc
assert !Setting.bcc_recipients?
assert_equal %w(issue_added issue_updated news_added), Setting.notified_events
assert_equal 'Test footer', Setting.emails_footer
app/models/mailer.rb (working copy)
recipients []
cc []
end
cc << Setting.mail_cc
super
end
app/views/settings/_notifications.rhtml (working copy)
<p><label><%= l(:setting_mail_from) %></label>
<%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %></p>
<p><label><%= l(:setting_mail_cc) %></label>
<%= text_field_tag 'settings[mail_cc]', Setting.mail_cc, :size => 60 %></p>
<p><label><%= l(:setting_bcc_recipients) %></label>
<%= check_box_tag 'settings[bcc_recipients]', 1, Setting.bcc_recipients? %>
<%= hidden_field_tag 'settings[bcc_recipients]', 0 %></p>
lang/en.yml (working copy)
setting_attachment_max_size: Attachment max. size
setting_issues_export_limit: Issues export limit
setting_mail_from: Emission email address
setting_mail_cc: CC email address for all notifications
setting_bcc_recipients: Blind carbon copy recipients (bcc)
setting_host_name: Host name
setting_text_formatting: Text formatting
config/settings.yml (working copy)
default: '25,50,100'
mail_from:
default: redmine@somenet.foo
mail_cc:
default:
bcc_recipients:
default: 1
text_formatting:
(1-1/2)