##// END OF EJS Templates
Email notifications are now sent as Blind carbon copy by default. This can be changed in email notifications settings (new setting added)....
Jean-Philippe Lang -
r931:bc060b31ae08
parent child
Show More
@@ -48,8 +48,9 class AdminController < ApplicationController
48 48 def mail_options
49 49 @notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
50 50 if request.post?
51 Setting.notified_events = (params[:notified_events] || [])
52 Setting.emails_footer = params[:emails_footer] if params[:emails_footer]
51 settings = (params[:settings] || {}).dup
52 settings[:notified_events] ||= []
53 settings.each { |name, value| Setting[name] = value }
53 54 flash[:notice] = l(:notice_successful_update)
54 55 redirect_to :controller => 'admin', :action => 'mail_options'
55 56 end
@@ -129,11 +129,20 class Mailer < ActionMailer::Base
129 129 default_url_options[:protocol] = Setting.protocol
130 130 end
131 131
132 # Overrides the create_mail method to remove the current user from the recipients and cc
133 # if he doesn't want to receive notifications about what he does
132 # Overrides the create_mail method
134 133 def create_mail
135 recipients.delete(User.current.mail) if recipients && User.current.pref[:no_self_notified]
136 cc.delete(User.current.mail) if cc && User.current.pref[:no_self_notified]
134 # Removes the current user from the recipients and cc
135 # if he doesn't want to receive notifications about what he does
136 if User.current.pref[:no_self_notified]
137 recipients.delete(User.current.mail) if recipients
138 cc.delete(User.current.mail) if cc
139 end
140 # Blind carbon copy recipients
141 if Setting.bcc_recipients?
142 bcc([recipients, cc].flatten.compact.uniq)
143 recipients []
144 cc []
145 end
137 146 super
138 147 end
139 148
@@ -6,16 +6,25
6 6
7 7 <% form_tag({:action => 'mail_options'}, :id => 'mail-options-form') do %>
8 8
9 <fieldset class="box tabular settings"><legend><%=l(:label_settings)%></legend>
10 <p><label><%= l(:setting_mail_from) %></label>
11 <%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %></p>
12
13 <p><label><%= l(:setting_bcc_recipients) %></label>
14 <%= check_box_tag 'settings[bcc_recipients]', 1, Setting.bcc_recipients? %>
15 <%= hidden_field_tag 'settings[bcc_recipients]', 0 %></p>
16 </fieldset>
17
9 18 <fieldset class="box"><legend><%=l(:text_select_mail_notifications)%></legend>
10 19 <% @notifiables.each do |notifiable| %>
11 <label><%= check_box_tag "notified_events[]", notifiable, Setting.notified_events.include?(notifiable) %>
20 <label><%= check_box_tag 'settings[notified_events][]', notifiable, Setting.notified_events.include?(notifiable) %>
12 21 <%= notifiable.humanize %></label><br />
13 22 <% end %>
14 23 <p><%= check_all_links('mail-options-form') %></p>
15 24 </fieldset>
16 25
17 26 <fieldset class="box"><legend><%= l(:setting_emails_footer) %></legend>
18 <%= text_area_tag 'emails_footer', Setting.emails_footer, :class => 'wiki-edit', :rows => 5 %>
27 <%= text_area_tag 'settings[emails_footer]', Setting.emails_footer, :class => 'wiki-edit', :rows => 5 %>
19 28 </fieldset>
20 29
21 30 <%= submit_tag l(:button_save) %>
@@ -1,8 +1,7
1 1 <h2><%= l(:label_settings) %></h2>
2 2
3 <div id="settings">
4 3 <% form_tag({:action => 'edit'}) do %>
5 <div class="box tabular">
4 <div class="box tabular settings">
6 5 <p><label><%= l(:setting_app_title) %></label>
7 6 <%= text_field_tag 'settings[app_title]', Setting.app_title, :size => 30 %></p>
8 7
@@ -34,9 +33,6
34 33 <p><label><%= l(:setting_cross_project_issue_relations) %></label>
35 34 <%= check_box_tag 'settings[cross_project_issue_relations]', 1, Setting.cross_project_issue_relations? %><%= hidden_field_tag 'settings[cross_project_issue_relations]', 0 %></p>
36 35
37 <p><label><%= l(:setting_mail_from) %></label>
38 <%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %></p>
39
40 36 <p><label><%= l(:setting_host_name) %></label>
41 37 <%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
42 38
@@ -101,5 +97,4
101 97 </fieldset>
102 98
103 99 <%= submit_tag l(:button_save) %>
104 </div>
105 100 <% end %>
@@ -39,6 +39,8 issues_export_limit:
39 39 default: 500
40 40 mail_from:
41 41 default: redmine@somenet.foo
42 bcc_recipients:
43 default: 1
42 44 text_formatting:
43 45 default: textile
44 46 wiki_compression:
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 547 field_time_zone: Time zone
548 548 text_caracters_minimum: Must be at least %d characters long.
549 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 547 field_time_zone: Time zone
548 548 text_caracters_minimum: Must be at least %d characters long.
549 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -546,3 +546,4 label_registration_manual_activation: Manuelle Kontoaktivierung
546 546 notice_account_pending: "Ihr Konto wurde erstellt und wartet jetzt auf die Genehmigung des Administrators."
547 547 field_time_zone: Zeitzone
548 548 text_caracters_minimum: Muss mindestens %d Zeichen lang sein.
549 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -180,6 +180,7 setting_self_registration: Self-registration
180 180 setting_attachment_max_size: Attachment max. size
181 181 setting_issues_export_limit: Issues export limit
182 182 setting_mail_from: Emission email address
183 setting_bcc_recipients: Blind carbon copy recipients (bcc)
183 184 setting_host_name: Host name
184 185 setting_text_formatting: Text formatting
185 186 setting_wiki_compression: Wiki history compression
@@ -549,3 +549,4 label_registration_automatic_activation: activación automática de cuenta
549 549 label_registration_manual_activation: activación manual de cuenta
550 550 notice_account_pending: "Su cuenta ha sido creada y está pendiende de la aprobación por parte de administrador"
551 551 setting_time_format: Formato de hora
552 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -180,6 +180,7 setting_self_registration: Inscription des nouveaux utilisateurs
180 180 setting_attachment_max_size: Taille max des fichiers
181 181 setting_issues_export_limit: Limite export demandes
182 182 setting_mail_from: Adresse d'émission
183 setting_bcc_recipients: Destinataires en copie cachée (cci)
183 184 setting_host_name: Nom d'hôte
184 185 setting_text_formatting: Formatage du texte
185 186 setting_wiki_compression: Compression historique wiki
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 547 field_time_zone: Time zone
548 548 text_caracters_minimum: Must be at least %d characters long.
549 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 547 field_time_zone: Time zone
548 548 text_caracters_minimum: Must be at least %d characters long.
549 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -547,3 +547,4 label_registration_manual_activation: manual account activation
547 547 notice_account_pending: "Your account was created and is now pending administrator approval."
548 548 field_time_zone: Time zone
549 549 text_caracters_minimum: Must be at least %d characters long.
550 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 547 field_time_zone: Time zone
548 548 text_caracters_minimum: Must be at least %d characters long.
549 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -547,3 +547,4 label_registration_manual_activation: manual account activation
547 547 notice_account_pending: "Your account was created and is now pending administrator approval."
548 548 field_time_zone: Time zone
549 549 text_caracters_minimum: Must be at least %d characters long.
550 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -546,3 +546,4 label_registration_manual_activation: manualna aktywacja kont
546 546 notice_account_pending: "Twoje konto zostało utworzone i oczekuje na zatwierdzenie administratora."
547 547 field_time_zone: Strefa czasowa
548 548 text_caracters_minimum: Must be at least %d characters long.
549 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 547 field_time_zone: Time zone
548 548 text_caracters_minimum: Must be at least %d characters long.
549 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 547 field_time_zone: Time zone
548 548 text_caracters_minimum: Must be at least %d characters long.
549 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation
546 546 notice_account_pending: "Your account was created and is now pending administrator approval."
547 547 field_time_zone: Time zone
548 548 text_caracters_minimum: Must be at least %d characters long.
549 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -546,3 +546,4 label_registration_manual_activation: активировать аккаунты
546 546 notice_account_pending: "Ваш аккаунт уже создан и ожидает подтверждения администратора."
547 547 field_time_zone: Часовой пояс
548 548 text_caracters_minimum: Must be at least %d characters long.
549 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -547,3 +547,4 label_registration_manual_activation: manual account activation
547 547 notice_account_pending: "Your account was created and is now pending administrator approval."
548 548 field_time_zone: Time zone
549 549 text_caracters_minimum: Must be at least %d characters long.
550 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -547,3 +547,4 label_registration_manual_activation: manual account activation
547 547 notice_account_pending: "Your account was created and is now pending administrator approval."
548 548 field_time_zone: Time zone
549 549 text_caracters_minimum: Must be at least %d characters long.
550 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -549,3 +549,4 label_registration_manual_activation: manual account activation
549 549 notice_account_pending: "Your account was created and is now pending administrator approval."
550 550 field_time_zone: Time zone
551 551 text_caracters_minimum: Must be at least %d characters long.
552 setting_bcc_recipients: Blind carbon copy recipients (bcc)
@@ -153,8 +153,8 width: 200px;
153 153
154 154 #preview fieldset {margin-top: 1em; background: url(../images/draft.png)}
155 155
156 #settings .tabular p{ padding-left: 300px; }
157 #settings .tabular label{ margin-left: -300px; width: 295px; }
156 .tabular.settings p{ padding-left: 300px; }
157 .tabular.settings label{ margin-left: -300px; width: 295px; }
158 158
159 159 .required {color: #bb0000;}
160 160 .summary {font-style: italic;}
General Comments 0
You need to be logged in to leave comments. Login now