Patch #1382 » add_cc_notification_v2.diff
test/functional/settings_controller_test.rb (working copy) | ||
---|---|---|
40 | 40 |
|
41 | 41 |
def test_post_edit_notifications |
42 | 42 |
post :edit, :settings => {:mail_from => 'functional@test.foo', |
43 |
:mail_cc => 'functionalcc@test.foo', |
|
43 | 44 |
:bcc_recipients => '0', |
44 | 45 |
:notified_events => %w(issue_added issue_updated news_added), |
45 | 46 |
:emails_footer => 'Test footer' |
46 | 47 |
} |
47 | 48 |
assert_redirected_to 'settings/edit' |
48 | 49 |
assert_equal 'functional@test.foo', Setting.mail_from |
50 |
assert_equal 'functionalcc@test.foo', Setting.mail_cc |
|
49 | 51 |
assert !Setting.bcc_recipients? |
50 | 52 |
assert_equal %w(issue_added issue_updated news_added), Setting.notified_events |
51 | 53 |
assert_equal 'Test footer', Setting.emails_footer |
app/models/mailer.rb (working copy) | ||
---|---|---|
28 | 28 |
'Issue-Author' => issue.author.login |
29 | 29 |
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to |
30 | 30 |
recipients issue.recipients |
31 |
# Add global cc |
|
32 |
cc [] |
|
33 |
cc << Setting.mail_cc |
|
31 | 34 |
subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}" |
32 | 35 |
body :issue => issue, |
33 | 36 |
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue) |
... | ... | |
42 | 45 |
recipients issue.recipients |
43 | 46 |
# Watchers in cc |
44 | 47 |
cc(issue.watcher_recipients - @recipients) |
48 |
# Add global cc |
|
49 |
cc << Setting.mail_cc |
|
45 | 50 |
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] " |
46 | 51 |
s << "(#{issue.status.name}) " if journal.new_value_for('status_id') |
47 | 52 |
s << issue.subject |
app/views/settings/_notifications.rhtml (working copy) | ||
---|---|---|
4 | 4 |
<p><label><%= l(:setting_mail_from) %></label> |
5 | 5 |
<%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %></p> |
6 | 6 | |
7 |
<p><label><%= l(:setting_mail_cc) %></label> |
|
8 |
<%= text_field_tag 'settings[mail_cc]', Setting.mail_cc, :size => 60 %></p> |
|
9 | ||
7 | 10 |
<p><label><%= l(:setting_bcc_recipients) %></label> |
8 | 11 |
<%= check_box_tag 'settings[bcc_recipients]', 1, Setting.bcc_recipients? %> |
9 | 12 |
<%= hidden_field_tag 'settings[bcc_recipients]', 0 %></p> |
lang/en.yml (working copy) | ||
---|---|---|
191 | 191 |
setting_attachment_max_size: Attachment max. size |
192 | 192 |
setting_issues_export_limit: Issues export limit |
193 | 193 |
setting_mail_from: Emission email address |
194 |
setting_mail_cc: CC email address for all notifications |
|
194 | 195 |
setting_bcc_recipients: Blind carbon copy recipients (bcc) |
195 | 196 |
setting_host_name: Host name |
196 | 197 |
setting_text_formatting: Text formatting |
config/settings.yml (working copy) | ||
---|---|---|
44 | 44 |
default: '25,50,100' |
45 | 45 |
mail_from: |
46 | 46 |
default: redmine@somenet.foo |
47 |
mail_cc: |
|
48 |
default: |
|
47 | 49 |
bcc_recipients: |
48 | 50 |
default: 1 |
49 | 51 |
text_formatting: |
- « Previous
- 1
- 2
- Next »