* Emails footer can now be customized from the admin interface (Admin -> Email notifications).

* Added html part to all email templates.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@858 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-10-21 14:10:07 +00:00
parent 2ee11c9089
commit a200e97667
38 changed files with 80 additions and 6 deletions

View File

@ -49,6 +49,7 @@ class AdminController < ApplicationController
@notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted) @notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
if request.post? if request.post?
Setting.notified_events = (params[:notified_events] || []) Setting.notified_events = (params[:notified_events] || [])
Setting.emails_footer = params[:emails_footer] if params[:emails_footer]
flash[:notice] = l(:notice_successful_update) flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'admin', :action => 'mail_options' redirect_to :controller => 'admin', :action => 'mail_options'
end end

View File

@ -8,12 +8,15 @@
<fieldset class="box"><legend><%=l(:text_select_mail_notifications)%></legend> <fieldset class="box"><legend><%=l(:text_select_mail_notifications)%></legend>
<% @notifiables.each do |notifiable| %> <% @notifiables.each do |notifiable| %>
<p><label><%= check_box_tag "notified_events[]", notifiable, Setting.notified_events.include?(notifiable) %> <label><%= check_box_tag "notified_events[]", notifiable, Setting.notified_events.include?(notifiable) %>
<%= notifiable.humanize %></label></p> <%= notifiable.humanize %></label><br />
<% end %> <% end %>
<div class="clear"></div> <p><%= check_all_links('mail-options-form') %></p>
</fieldset>
<fieldset class="box"><legend>Emails footer</legend>
<%= text_area_tag 'emails_footer', Setting.emails_footer, :class => 'wiki-edit', :rows => 5 %>
</fieldset> </fieldset>
<p><%= check_all_links('mail-options-form') %></p>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -7,3 +7,6 @@ Log in: <%= url_for :only_path => false, :host => Setting.host_name, :controller
<% unless @user.auth_source %> <% unless @user.auth_source %>
You can change your password here: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'my', :action => 'account' %> You can change your password here: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'my', :action => 'account' %>
<% end %> <% end %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -7,3 +7,6 @@ Pour se connecter à l'application: <%= url_for :only_path => false, :host => Se
<% unless @user.auth_source %> <% unless @user.auth_source %>
Vous pouvez changer votre mot de passe à l'adresse: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'my', :action => 'account' %> Vous pouvez changer votre mot de passe à l'adresse: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'my', :action => 'account' %>
<% end %> <% end %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -7,3 +7,6 @@ Zaloguj: <%= url_for :only_path => false, :host => Setting.host_name, :controlle
<% unless @user.auth_source %> <% unless @user.auth_source %>
Możesz zmienić swoje hasło tutaj: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'my', :action => 'account' %> Możesz zmienić swoje hasło tutaj: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'my', :action => 'account' %>
<% end %> <% end %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -3,3 +3,5 @@
<ul><% @attachments.each do |attachment | %> <ul><% @attachments.each do |attachment | %>
<li><%= attachment.filename %></li> <li><%= attachment.filename %></li>
<% end %></ul> <% end %></ul>
<hr />
<small><em><%= textilizable Setting.emails_footer %></em></small>

View File

@ -2,3 +2,5 @@
- <%= attachment.filename %><% end %> - <%= attachment.filename %><% end %>
<%= url_for @url %> <%= url_for @url %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -2,3 +2,5 @@
(<%= @document.category.name %>)<br /> (<%= @document.category.name %>)<br />
<br /> <br />
<%= textilizable(@document.description) %> <%= textilizable(@document.description) %>
<hr />
<small><em><%= textilizable Setting.emails_footer %></em></small>

View File

@ -2,3 +2,5 @@
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %> <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
<%= @document.description %> <%= @document.description %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -1,3 +1,5 @@
<%= l(:text_issue_added, "##{@issue.id}") %> <%= l(:text_issue_added, "##{@issue.id}") %>
<hr /> <hr />
<%= render :file => "_issue_text_html", :use_full_path => true, :locals => { :issue => @issue } %> <%= render :file => "_issue_text_html", :use_full_path => true, :locals => { :issue => @issue } %>
<hr />
<small><em><%= textilizable Setting.emails_footer %></em></small>

View File

@ -1,3 +1,5 @@
<%= l(:text_issue_added, "##{@issue.id}") %> <%= l(:text_issue_added, "##{@issue.id}") %>
---------------------------------------- ----------------------------------------
<%= render :file => "_issue_text_plain", :use_full_path => true, :locals => { :issue => @issue } %> <%= render :file => "_issue_text_plain", :use_full_path => true, :locals => { :issue => @issue } %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -8,3 +8,5 @@
<%= textilizable(@journal.notes) %> <%= textilizable(@journal.notes) %>
<hr /> <hr />
<%= render :file => "_issue_text_html", :use_full_path => true, :locals => { :issue => @issue } %> <%= render :file => "_issue_text_html", :use_full_path => true, :locals => { :issue => @issue } %>
<hr />
<small><em><%= textilizable Setting.emails_footer %></em></small>

View File

@ -6,3 +6,5 @@
<%= @journal.notes if @journal.notes? %> <%= @journal.notes if @journal.notes? %>
---------------------------------------- ----------------------------------------
<%= render :file => "_issue_text_plain", :use_full_path => true, :locals => { :issue => @issue } %> <%= render :file => "_issue_text_plain", :use_full_path => true, :locals => { :issue => @issue } %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -1,2 +1,5 @@
<%= l(:mail_body_lost_password) %> <%= l(:mail_body_lost_password) %>
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'lost_password', :token => @token.value %> <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'lost_password', :token => @token.value %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -0,0 +1,6 @@
<%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to @message.subject, :only_path => false, :host => Setting.host_name, :controller => 'messages', :action => 'show', :board_id => @message.board_id, :id => @message.root %><br />
<em><%= @message.author.name %></em>
<%= textilizable @message.content %>
<hr />
<small><em><%= textilizable Setting.emails_footer %></em></small>

View File

@ -1,4 +1,6 @@
<%= l(:field_author) %>: <%= @message.author.name %>
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'messages', :action => 'show', :board_id => @message.board_id, :id => @message.root %> <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'messages', :action => 'show', :board_id => @message.board_id, :id => @message.root %>
<%= @message.author.name %>
<%= @message.content %> <%= @message.content %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -2,3 +2,5 @@
<em><%= @news.author.name %></em> <em><%= @news.author.name %></em>
<%= textilizable(@news.description) %> <%= textilizable(@news.description) %>
<hr />
<small><em><%= textilizable Setting.emails_footer %></em></small>

View File

@ -3,3 +3,5 @@
<%= @news.author.name %> <%= @news.author.name %>
<%= @news.description %> <%= @news.description %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -1,2 +1,5 @@
<%= l(:mail_body_register) %> <%= l(:mail_body_register) %>
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'register', :token => @token.value %> <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'register', :token => @token.value %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -0,0 +1,5 @@
<p>This is a test email sent by Redmine.<br />
Redmine URL: <%= link_to url_for(:only_path => false, :host => Setting.host_name, :controller => 'welcome'),
url_for(:only_path => false, :host => Setting.host_name, :controller => 'welcome') %></p>
<hr />
<small><em><%= textilizable Setting.emails_footer %></em></small>

View File

@ -1,3 +1,5 @@
This is a test email sent by Redmine. This is a test email sent by Redmine.
Redmine URL: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'welcome' %> Redmine URL: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'welcome' %>
----------------------------------------
<%= Setting.emails_footer %>

View File

@ -96,4 +96,8 @@ repositories_encodings:
default: '' default: ''
ui_theme: ui_theme:
default: '' default: ''
emails_footer:
default: |-
You have received this notification because you have either subscribed to it, or are involved in.
To change your notification preferences, please click here: http://hostname/my/account

View File

@ -531,3 +531,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -531,3 +531,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -531,3 +531,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -188,6 +188,7 @@ setting_date_format: Date format
setting_cross_project_issue_relations: Allow cross-project issue relations setting_cross_project_issue_relations: Allow cross-project issue relations
setting_issue_list_default_columns: Default columns displayed on the issue list setting_issue_list_default_columns: Default columns displayed on the issue list
setting_repositories_encodings: Repositories encodings setting_repositories_encodings: Repositories encodings
setting_emails_footer: Emails footer
label_user: User label_user: User
label_user_plural: Users label_user_plural: Users

View File

@ -534,3 +534,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -188,6 +188,7 @@ setting_date_format: Format de date
setting_cross_project_issue_relations: Autoriser les relations entre demandes de différents projets setting_cross_project_issue_relations: Autoriser les relations entre demandes de différents projets
setting_issue_list_default_columns: Colonnes affichées par défaut sur la liste des demandes setting_issue_list_default_columns: Colonnes affichées par défaut sur la liste des demandes
setting_repositories_encodings: Encodages des dépôts setting_repositories_encodings: Encodages des dépôts
setting_emails_footer: Pied-de-page des emails
label_user: Utilisateur label_user: Utilisateur
label_user_plural: Utilisateurs label_user_plural: Utilisateurs

View File

@ -531,3 +531,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -531,3 +531,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -532,3 +532,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -532,3 +532,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -531,3 +531,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -531,3 +531,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -531,3 +531,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -531,3 +531,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -532,3 +532,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer

View File

@ -534,3 +534,4 @@ text_user_mail_option: "For unselected projects, you will only receive notificat
label_user_mail_option_selected: "For any event on the selected projects only..." label_user_mail_option_selected: "For any event on the selected projects only..."
label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_all: "For any event on all my projects"
label_user_mail_option_none: "Only for things I watch or I'm involved in" label_user_mail_option_none: "Only for things I watch or I'm involved in"
setting_emails_footer: Emails footer