Patch #1382 » add_cc_notification_v2.diff
| 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) | ||
|---|---|---|
|
'Issue-Author' => issue.author.login
|
||
|
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
|
||
|
recipients issue.recipients
|
||
|
# Add global cc
|
||
|
cc []
|
||
|
cc << Setting.mail_cc
|
||
|
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)
|
||
| ... | ... | |
|
recipients issue.recipients
|
||
|
# Watchers in cc
|
||
|
cc(issue.watcher_recipients - @recipients)
|
||
|
# Add global cc
|
||
|
cc << Setting.mail_cc
|
||
|
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
|
||
|
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
|
||
|
s << issue.subject
|
||
| 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:
|
||
- « Previous
- 1
- 2
- Next »