summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-21 14:10:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-21 14:10:07 +0000
commita200e97667a7367945389b5b6934c4a04d33f750 (patch)
tree0c041032b1b17c9b8330faefb4695b36259abcf6 /app
parent2ee11c9089f5390508dfb786b0cbb7c6030ae605 (diff)
downloadredmine-a200e97667a7367945389b5b6934c4a04d33f750.tar.gz
redmine-a200e97667a7367945389b5b6934c4a04d33f750.zip
* 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
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin_controller.rb1
-rw-r--r--app/views/admin/mail_options.rhtml11
-rw-r--r--app/views/mailer/account_information.rhtml3
-rw-r--r--app/views/mailer/account_information_fr.rhtml3
-rw-r--r--app/views/mailer/account_information_pl.rhtml3
-rw-r--r--app/views/mailer/attachments_added.text.html.rhtml2
-rw-r--r--app/views/mailer/attachments_added.text.plain.rhtml2
-rw-r--r--app/views/mailer/document_added.text.html.rhtml2
-rw-r--r--app/views/mailer/document_added.text.plain.rhtml2
-rw-r--r--app/views/mailer/issue_add.text.html.rhtml2
-rw-r--r--app/views/mailer/issue_add.text.plain.rhtml2
-rw-r--r--app/views/mailer/issue_edit.text.html.rhtml2
-rw-r--r--app/views/mailer/issue_edit.text.plain.rhtml2
-rw-r--r--app/views/mailer/lost_password.rhtml3
-rw-r--r--app/views/mailer/message_posted.text.html.rhtml6
-rw-r--r--app/views/mailer/message_posted.text.plain.rhtml (renamed from app/views/mailer/message_posted.rhtml)4
-rw-r--r--app/views/mailer/news_added.text.html.rhtml2
-rw-r--r--app/views/mailer/news_added.text.plain.rhtml2
-rw-r--r--app/views/mailer/register.rhtml3
-rw-r--r--app/views/mailer/test.text.html.rhtml5
-rw-r--r--app/views/mailer/test.text.plain.rhtml (renamed from app/views/mailer/test.rhtml)4
21 files changed, 60 insertions, 6 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index bceab361c..b448affcc 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -49,6 +49,7 @@ class AdminController < ApplicationController
@notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
if request.post?
Setting.notified_events = (params[:notified_events] || [])
+ Setting.emails_footer = params[:emails_footer] if params[:emails_footer]
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'admin', :action => 'mail_options'
end
diff --git a/app/views/admin/mail_options.rhtml b/app/views/admin/mail_options.rhtml
index 2f61af4fa..5f1fd9bb3 100644
--- a/app/views/admin/mail_options.rhtml
+++ b/app/views/admin/mail_options.rhtml
@@ -8,12 +8,15 @@
<fieldset class="box"><legend><%=l(:text_select_mail_notifications)%></legend>
<% @notifiables.each do |notifiable| %>
- <p><label><%= check_box_tag "notified_events[]", notifiable, Setting.notified_events.include?(notifiable) %>
- <%= notifiable.humanize %></label></p>
+ <label><%= check_box_tag "notified_events[]", notifiable, Setting.notified_events.include?(notifiable) %>
+ <%= notifiable.humanize %></label><br />
<% 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>
-<p><%= check_all_links('mail-options-form') %></p>
<%= submit_tag l(:button_save) %>
<% end %>
diff --git a/app/views/mailer/account_information.rhtml b/app/views/mailer/account_information.rhtml
index 058d5fc44..98b2916a7 100644
--- a/app/views/mailer/account_information.rhtml
+++ b/app/views/mailer/account_information.rhtml
@@ -7,3 +7,6 @@ Log in: <%= url_for :only_path => false, :host => Setting.host_name, :controller
<% unless @user.auth_source %>
You can change your password here: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'my', :action => 'account' %>
<% end %>
+
+----------------------------------------
+<%= Setting.emails_footer %>
diff --git a/app/views/mailer/account_information_fr.rhtml b/app/views/mailer/account_information_fr.rhtml
index 9210988f4..71df34532 100644
--- a/app/views/mailer/account_information_fr.rhtml
+++ b/app/views/mailer/account_information_fr.rhtml
@@ -7,3 +7,6 @@ Pour se connecter à l'application: <%= url_for :only_path => false, :host => Se
<% 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' %>
<% end %>
+
+----------------------------------------
+<%= Setting.emails_footer %>
diff --git a/app/views/mailer/account_information_pl.rhtml b/app/views/mailer/account_information_pl.rhtml
index f73108a74..7f9060b2d 100644
--- a/app/views/mailer/account_information_pl.rhtml
+++ b/app/views/mailer/account_information_pl.rhtml
@@ -7,3 +7,6 @@ Zaloguj: <%= url_for :only_path => false, :host => Setting.host_name, :controlle
<% unless @user.auth_source %>
Możesz zmienić swoje hasło tutaj: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'my', :action => 'account' %>
<% end %>
+
+----------------------------------------
+<%= Setting.emails_footer %>
diff --git a/app/views/mailer/attachments_added.text.html.rhtml b/app/views/mailer/attachments_added.text.html.rhtml
index 336cad69b..9bb30db1d 100644
--- a/app/views/mailer/attachments_added.text.html.rhtml
+++ b/app/views/mailer/attachments_added.text.html.rhtml
@@ -3,3 +3,5 @@
<ul><% @attachments.each do |attachment | %>
<li><%= attachment.filename %></li>
<% end %></ul>
+<hr />
+<small><em><%= textilizable Setting.emails_footer %></em></small>
diff --git a/app/views/mailer/attachments_added.text.plain.rhtml b/app/views/mailer/attachments_added.text.plain.rhtml
index 22df2203c..7e4245ef2 100644
--- a/app/views/mailer/attachments_added.text.plain.rhtml
+++ b/app/views/mailer/attachments_added.text.plain.rhtml
@@ -2,3 +2,5 @@
- <%= attachment.filename %><% end %>
<%= url_for @url %>
+----------------------------------------
+<%= Setting.emails_footer %>
diff --git a/app/views/mailer/document_added.text.html.rhtml b/app/views/mailer/document_added.text.html.rhtml
index 2a574a1cc..d7d6558b8 100644
--- a/app/views/mailer/document_added.text.html.rhtml
+++ b/app/views/mailer/document_added.text.html.rhtml
@@ -2,3 +2,5 @@
(<%= @document.category.name %>)<br />
<br />
<%= textilizable(@document.description) %>
+<hr />
+<small><em><%= textilizable Setting.emails_footer %></em></small>
diff --git a/app/views/mailer/document_added.text.plain.rhtml b/app/views/mailer/document_added.text.plain.rhtml
index ee8f3e6be..bb42758f7 100644
--- a/app/views/mailer/document_added.text.plain.rhtml
+++ b/app/views/mailer/document_added.text.plain.rhtml
@@ -2,3 +2,5 @@
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
<%= @document.description %>
+----------------------------------------
+<%= Setting.emails_footer %>
diff --git a/app/views/mailer/issue_add.text.html.rhtml b/app/views/mailer/issue_add.text.html.rhtml
index a7ef8ece8..7a0712c36 100644
--- a/app/views/mailer/issue_add.text.html.rhtml
+++ b/app/views/mailer/issue_add.text.html.rhtml
@@ -1,3 +1,5 @@
<%= l(:text_issue_added, "##{@issue.id}") %>
<hr />
<%= render :file => "_issue_text_html", :use_full_path => true, :locals => { :issue => @issue } %>
+<hr />
+<small><em><%= textilizable Setting.emails_footer %></em></small>
diff --git a/app/views/mailer/issue_add.text.plain.rhtml b/app/views/mailer/issue_add.text.plain.rhtml
index a9aa13b3d..a5740ad89 100644
--- a/app/views/mailer/issue_add.text.plain.rhtml
+++ b/app/views/mailer/issue_add.text.plain.rhtml
@@ -1,3 +1,5 @@
<%= l(:text_issue_added, "##{@issue.id}") %>
----------------------------------------
<%= render :file => "_issue_text_plain", :use_full_path => true, :locals => { :issue => @issue } %>
+----------------------------------------
+<%= Setting.emails_footer %>
diff --git a/app/views/mailer/issue_edit.text.html.rhtml b/app/views/mailer/issue_edit.text.html.rhtml
index 59c767c9f..fddd19431 100644
--- a/app/views/mailer/issue_edit.text.html.rhtml
+++ b/app/views/mailer/issue_edit.text.html.rhtml
@@ -8,3 +8,5 @@
<%= textilizable(@journal.notes) %>
<hr />
<%= render :file => "_issue_text_html", :use_full_path => true, :locals => { :issue => @issue } %>
+<hr />
+<small><em><%= textilizable Setting.emails_footer %></em></small>
diff --git a/app/views/mailer/issue_edit.text.plain.rhtml b/app/views/mailer/issue_edit.text.plain.rhtml
index 4431d46d5..4ecc37549 100644
--- a/app/views/mailer/issue_edit.text.plain.rhtml
+++ b/app/views/mailer/issue_edit.text.plain.rhtml
@@ -6,3 +6,5 @@
<%= @journal.notes if @journal.notes? %>
----------------------------------------
<%= render :file => "_issue_text_plain", :use_full_path => true, :locals => { :issue => @issue } %>
+----------------------------------------
+<%= Setting.emails_footer %>
diff --git a/app/views/mailer/lost_password.rhtml b/app/views/mailer/lost_password.rhtml
index ea2e58abb..5b5bb3b90 100644
--- a/app/views/mailer/lost_password.rhtml
+++ b/app/views/mailer/lost_password.rhtml
@@ -1,2 +1,5 @@
<%= l(:mail_body_lost_password) %>
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'lost_password', :token => @token.value %>
+
+----------------------------------------
+<%= Setting.emails_footer %>
diff --git a/app/views/mailer/message_posted.text.html.rhtml b/app/views/mailer/message_posted.text.html.rhtml
new file mode 100644
index 000000000..89346e724
--- /dev/null
+++ b/app/views/mailer/message_posted.text.html.rhtml
@@ -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>
diff --git a/app/views/mailer/message_posted.rhtml b/app/views/mailer/message_posted.text.plain.rhtml
index 10b46c41e..97539fd01 100644
--- a/app/views/mailer/message_posted.rhtml
+++ b/app/views/mailer/message_posted.text.plain.rhtml
@@ -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 %>
+<%= @message.author.name %>
<%= @message.content %>
+----------------------------------------
+<%= Setting.emails_footer %>
diff --git a/app/views/mailer/news_added.text.html.rhtml b/app/views/mailer/news_added.text.html.rhtml
index 7de6f48e8..e99dfd5bc 100644
--- a/app/views/mailer/news_added.text.html.rhtml
+++ b/app/views/mailer/news_added.text.html.rhtml
@@ -2,3 +2,5 @@
<em><%= @news.author.name %></em>
<%= textilizable(@news.description) %>
+<hr />
+<small><em><%= textilizable Setting.emails_footer %></em></small>
diff --git a/app/views/mailer/news_added.text.plain.rhtml b/app/views/mailer/news_added.text.plain.rhtml
index 7ee24b10a..1a04af9ca 100644
--- a/app/views/mailer/news_added.text.plain.rhtml
+++ b/app/views/mailer/news_added.text.plain.rhtml
@@ -3,3 +3,5 @@
<%= @news.author.name %>
<%= @news.description %>
+----------------------------------------
+<%= Setting.emails_footer %>
diff --git a/app/views/mailer/register.rhtml b/app/views/mailer/register.rhtml
index 7e4f95f46..55fcf1e10 100644
--- a/app/views/mailer/register.rhtml
+++ b/app/views/mailer/register.rhtml
@@ -1,2 +1,5 @@
<%= l(:mail_body_register) %>
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'register', :token => @token.value %>
+
+----------------------------------------
+<%= Setting.emails_footer %>
diff --git a/app/views/mailer/test.text.html.rhtml b/app/views/mailer/test.text.html.rhtml
new file mode 100644
index 000000000..f1cb1881a
--- /dev/null
+++ b/app/views/mailer/test.text.html.rhtml
@@ -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>
diff --git a/app/views/mailer/test.rhtml b/app/views/mailer/test.text.plain.rhtml
index deffa53e2..0519caab5 100644
--- a/app/views/mailer/test.rhtml
+++ b/app/views/mailer/test.text.plain.rhtml
@@ -1,3 +1,5 @@
This is a test email sent by Redmine.
-
Redmine URL: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'welcome' %>
+
+----------------------------------------
+<%= Setting.emails_footer %>