Mailer:
* added an application setting to specify the application protocol (http or https) used to generate urls * added layouts for text and html emails * no more language specific templates * urls are now generated using UrlWriter * the mailer now uses AdvAttrAccessor code style to set email parameters git-svn-id: http://redmine.rubyforge.org/svn/trunk@877 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
4ded4277c5
commit
bd434427e6
|
@ -20,99 +20,111 @@ class Mailer < ActionMailer::Base
|
||||||
helper IssuesHelper
|
helper IssuesHelper
|
||||||
helper CustomFieldsHelper
|
helper CustomFieldsHelper
|
||||||
|
|
||||||
def account_information(user, password)
|
include ActionController::UrlWriter
|
||||||
set_language_if_valid user.language
|
|
||||||
recipients user.mail
|
|
||||||
from Setting.mail_from
|
|
||||||
subject l(:mail_subject_register)
|
|
||||||
body :user => user, :password => password
|
|
||||||
end
|
|
||||||
|
|
||||||
def issue_add(issue)
|
def issue_add(issue)
|
||||||
set_language_if_valid(Setting.default_language)
|
recipients issue.recipients
|
||||||
@recipients = issue.recipients
|
subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
|
||||||
@from = Setting.mail_from
|
body :issue => issue,
|
||||||
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
|
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
|
||||||
@body['issue'] = issue
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def issue_edit(journal)
|
def issue_edit(journal)
|
||||||
set_language_if_valid(Setting.default_language)
|
|
||||||
issue = journal.journalized
|
issue = journal.journalized
|
||||||
@recipients = issue.recipients
|
recipients issue.recipients
|
||||||
# Watchers in cc
|
# Watchers in cc
|
||||||
@cc = issue.watcher_recipients - @recipients
|
cc(issue.watcher_recipients - @recipients)
|
||||||
@from = Setting.mail_from
|
subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
|
||||||
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
|
body :issue => issue,
|
||||||
@body['issue'] = issue
|
:journal => journal,
|
||||||
@body['journal']= journal
|
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
|
||||||
end
|
end
|
||||||
|
|
||||||
def document_added(document)
|
def document_added(document)
|
||||||
set_language_if_valid(Setting.default_language)
|
recipients document.project.recipients
|
||||||
@recipients = document.project.recipients
|
subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
|
||||||
@from = Setting.mail_from
|
body :document => document,
|
||||||
@subject = "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
|
:document_url => url_for(:controller => 'documents', :action => 'show', :id => document)
|
||||||
@body['document'] = document
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def attachments_added(attachments)
|
def attachments_added(attachments)
|
||||||
set_language_if_valid(Setting.default_language)
|
|
||||||
container = attachments.first.container
|
container = attachments.first.container
|
||||||
url = ''
|
|
||||||
added_to = ''
|
added_to = ''
|
||||||
|
added_to_url = ''
|
||||||
case container.class.name
|
case container.class.name
|
||||||
when 'Version'
|
when 'Version'
|
||||||
url = {:only_path => false, :host => Setting.host_name, :controller => 'projects', :action => 'list_files', :id => container.project_id}
|
added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container.project_id)
|
||||||
added_to = "#{l(:label_version)}: #{container.name}"
|
added_to = "#{l(:label_version)}: #{container.name}"
|
||||||
when 'Document'
|
when 'Document'
|
||||||
url = {:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id}
|
added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id)
|
||||||
added_to = "#{l(:label_document)}: #{container.title}"
|
added_to = "#{l(:label_document)}: #{container.title}"
|
||||||
end
|
end
|
||||||
@recipients = container.project.recipients
|
recipients container.project.recipients
|
||||||
@from = Setting.mail_from
|
subject "[#{container.project.name}] #{l(:label_attachment_new)}"
|
||||||
@subject = "[#{container.project.name}] #{l(:label_attachment_new)}"
|
body :attachments => attachments,
|
||||||
@body['attachments'] = attachments
|
:added_to => added_to,
|
||||||
@body['url'] = url
|
:added_to_url => added_to_url
|
||||||
@body['added_to'] = added_to
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def news_added(news)
|
def news_added(news)
|
||||||
set_language_if_valid(Setting.default_language)
|
recipients news.project.recipients
|
||||||
@recipients = news.project.recipients
|
subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
|
||||||
@from = Setting.mail_from
|
body :news => news,
|
||||||
@subject = "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
|
:news_url => url_for(:controller => 'news', :action => 'show', :id => news)
|
||||||
@body['news'] = news
|
end
|
||||||
|
|
||||||
|
def message_posted(message, recipients)
|
||||||
|
recipients(recipients)
|
||||||
|
subject "[#{message.board.project.name} - #{message.board.name}] #{message.subject}"
|
||||||
|
body :message => message,
|
||||||
|
:message_url => url_for(:controller => 'messages', :action => 'show', :board_id => message.board_id, :id => message.root)
|
||||||
|
end
|
||||||
|
|
||||||
|
def account_information(user, password)
|
||||||
|
set_language_if_valid user.language
|
||||||
|
recipients user.mail
|
||||||
|
subject l(:mail_subject_register)
|
||||||
|
body :user => user,
|
||||||
|
:password => password,
|
||||||
|
:login_url => url_for(:controller => 'account', :action => 'login')
|
||||||
end
|
end
|
||||||
|
|
||||||
def lost_password(token)
|
def lost_password(token)
|
||||||
set_language_if_valid(token.user.language)
|
set_language_if_valid(token.user.language)
|
||||||
@recipients = token.user.mail
|
recipients token.user.mail
|
||||||
@from = Setting.mail_from
|
subject l(:mail_subject_lost_password)
|
||||||
@subject = l(:mail_subject_lost_password)
|
body :token => token,
|
||||||
@body['token'] = token
|
:url => url_for(:controller => 'account', :action => 'lost_password', :token => token.value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def register(token)
|
def register(token)
|
||||||
set_language_if_valid(token.user.language)
|
set_language_if_valid(token.user.language)
|
||||||
@recipients = token.user.mail
|
recipients token.user.mail
|
||||||
@from = Setting.mail_from
|
subject l(:mail_subject_register)
|
||||||
@subject = l(:mail_subject_register)
|
body :token => token,
|
||||||
@body['token'] = token
|
:url => url_for(:controller => 'account', :action => 'register', :token => token.value)
|
||||||
end
|
|
||||||
|
|
||||||
def message_posted(message, recipients)
|
|
||||||
set_language_if_valid(Setting.default_language)
|
|
||||||
@recipients = recipients
|
|
||||||
@from = Setting.mail_from
|
|
||||||
@subject = "[#{message.board.project.name} - #{message.board.name}] #{message.subject}"
|
|
||||||
@body['message'] = message
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test(user)
|
def test(user)
|
||||||
set_language_if_valid(user.language)
|
set_language_if_valid(user.language)
|
||||||
@recipients = user.mail
|
recipients user.mail
|
||||||
@from = Setting.mail_from
|
subject 'Redmine test'
|
||||||
@subject = 'Redmine'
|
body :url => url_for(:controller => 'welcome')
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def initialize_defaults(method_name)
|
||||||
|
super
|
||||||
|
set_language_if_valid Setting.default_language
|
||||||
|
from Setting.mail_from
|
||||||
|
default_url_options[:host] = Setting.host_name
|
||||||
|
default_url_options[:protocol] = Setting.protocol
|
||||||
|
end
|
||||||
|
|
||||||
|
# Renders a message with the corresponding layout
|
||||||
|
def render_message(method_name, body)
|
||||||
|
layout = method_name.match(%r{text\.html\.(rhtml|rxml)}) ? 'layout.text.html.rhtml' : 'layout.text.plain.rhtml'
|
||||||
|
body[:content_for_layout] = render(:file => method_name, :body => body)
|
||||||
|
ActionView::Base.new(File.join(template_root, 'mailer'), body, self).render(:file => layout)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<%= link_to "#{issue.tracker.name} ##{issue.id}", :only_path => false, :host => Setting.host_name, :controller => 'issues', :action => 'show', :id => issue %>:
|
<h1><%= link_to "#{issue.tracker.name} ##{issue.id}: #{issue.subject}", issue_url %></h1>
|
||||||
<%= issue.subject %>
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><%=l(:field_author)%>: <%= issue.author %></li>
|
<li><%=l(:field_author)%>: <%= issue.author %></li>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<%= "#{issue.tracker.name} ##{issue.id}: #{issue.subject}" %>
|
<%= "#{issue.tracker.name} ##{issue.id}: #{issue.subject}" %>
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'issues', :action => 'show', :id => issue %>
|
<%= issue_url %>
|
||||||
|
|
||||||
<%=l(:field_author)%>: <%= issue.author %>
|
<%=l(:field_author)%>: <%= issue.author %>
|
||||||
<%=l(:field_status)%>: <%= issue.status %>
|
<%=l(:field_status)%>: <%= issue.status %>
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
<% if @user.auth_source %>You can use your "<%= @user.auth_source.name %>" account to log into Redmine.
|
|
||||||
<% else %>Your Redmine account information:
|
|
||||||
* Login: <%= @user.login %>
|
|
||||||
* Password: <%= @password %>
|
|
||||||
<% end %>
|
|
||||||
Log in: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'login' %>
|
|
||||||
<% 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 %>
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<% if @user.auth_source %>
|
||||||
|
<p><%= l(:mail_body_account_information_external, @user.auth_source.name) %></p>
|
||||||
|
<% else %>
|
||||||
|
<p><%= l(:mail_body_account_information) %>:</p>
|
||||||
|
<ul>
|
||||||
|
<li><%= l(:field_login) %>: <%= @user.login %></li>
|
||||||
|
<li><%= l(:field_password) %>: <%= @password %></li>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<p><%= l(:label_login) %>: <%= auto_link(@login_url) %></p>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<% if @user.auth_source %><%= l(:mail_body_account_information_external, @user.auth_source.name) %>
|
||||||
|
<% else %><%= l(:mail_body_account_information) %>:
|
||||||
|
* <%= l(:field_login) %>: <%= @user.login %>
|
||||||
|
* <%= l(:field_password) %>: <%= @password %>
|
||||||
|
<% end %>
|
||||||
|
<%= l(:label_login) %>: <%= @login_url %>
|
|
@ -1,12 +0,0 @@
|
||||||
<% if @user.auth_source %>Vous pouvez utiliser votre compte "<%= @user.auth_source.name %>" pour vous connecter à Redmine.
|
|
||||||
<% else %>Paramètres de connexion de votre compte Redmine:
|
|
||||||
* Identifiant: <%= @user.login %>
|
|
||||||
* Mot de passe: <%= @password %>
|
|
||||||
<% end %>
|
|
||||||
Pour se connecter à l'application: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'login' %>
|
|
||||||
<% 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 %>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<% if @user.auth_source %>Możesz użyć twojego "<%= @user.auth_source.name %>" konta do zalogowania do Redmine.
|
|
||||||
<% else %>Twoje konto w Redmine:
|
|
||||||
* Login: <%= @user.login %>
|
|
||||||
* Hasło: <%= @password %>
|
|
||||||
<% end %>
|
|
||||||
Zaloguj: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'login' %>
|
|
||||||
<% 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 %>
|
|
|
@ -1,9 +0,0 @@
|
||||||
<% if @user.auth_source %>Mozete koristiti vas "<%= @user.auth_source.name %>" nalog da bi ste se prikljucili na Redmine.
|
|
||||||
<% else %>Informacije o vasem Redmine nalogu:
|
|
||||||
* Login: <%= @user.login %>
|
|
||||||
* Password: <%= @password %>
|
|
||||||
<% end %>
|
|
||||||
Log in: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'login' %>
|
|
||||||
<% unless @user.auth_source %>
|
|
||||||
Ovde mozete izmeniti svoju lozinku: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'my', :action => 'account' %>
|
|
||||||
<% end %>
|
|
|
@ -1,7 +1,5 @@
|
||||||
<%= link_to @added_to, @url %><br />
|
<%= link_to @added_to, @added_to_url %><br />
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<%= @added_to %><% @attachments.each do |attachment | %>
|
<%= @added_to %><% @attachments.each do |attachment | %>
|
||||||
- <%= attachment.filename %><% end %>
|
- <%= attachment.filename %><% end %>
|
||||||
|
|
||||||
<%= url_for @url %>
|
<%= @added_to_url %>
|
||||||
----------------------------------------
|
|
||||||
<%= Setting.emails_footer %>
|
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
<%= link_to @document.title, :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
<%= link_to @document.title, @document_url %> (<%= @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>
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<%= @document.title %> (<%= @document.category.name %>)
|
<%= @document.title %> (<%= @document.category.name %>)
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
<%= @document_url %>
|
||||||
|
|
||||||
<%= @document.description %>
|
<%= @document.description %>
|
||||||
----------------------------------------
|
|
||||||
<%= Setting.emails_footer %>
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
<%= 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, :issue_url => @issue_url } %>
|
||||||
<hr />
|
|
||||||
<small><em><%= textilizable Setting.emails_footer %></em></small>
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
<%= 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, :issue_url => @issue_url } %>
|
||||||
----------------------------------------
|
|
||||||
<%= Setting.emails_footer %>
|
|
||||||
|
|
|
@ -7,6 +7,4 @@
|
||||||
</ul>
|
</ul>
|
||||||
<%= 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, :issue_url => @issue_url } %>
|
||||||
<hr />
|
|
||||||
<small><em><%= textilizable Setting.emails_footer %></em></small>
|
|
||||||
|
|
|
@ -5,6 +5,4 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= @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, :issue_url => @issue_url } %>
|
||||||
----------------------------------------
|
|
||||||
<%= Setting.emails_footer %>
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
body { font-family: Verdana, sans-serif; font-size: 0.8em; color:#484848; }
|
||||||
|
body h1 { font-family: "Trebuchet MS", Verdana, sans-serif; font-size: 1.2em; margin: 0;}
|
||||||
|
a, a:link, a:visited{ color: #2A5685; }
|
||||||
|
a:hover, a:active{ color: #c61a1a; }
|
||||||
|
hr { width: 100%; height: 1px; background: #ccc; border: 0; }
|
||||||
|
.footer { font-size: 0.8em; font-style: italic; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<%= yield %>
|
||||||
|
<hr />
|
||||||
|
<span class="footer"><%= Redmine::WikiFormatting.to_html(Setting.emails_footer) %></span>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<%= yield %>
|
||||||
|
----------------------------------------
|
||||||
|
<%= Setting.emails_footer %>
|
|
@ -1,5 +0,0 @@
|
||||||
<%= 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 %>
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
<p><%= l(:mail_body_lost_password) %><br />
|
||||||
|
<%= auto_link(@url) %></p>
|
|
@ -0,0 +1,2 @@
|
||||||
|
<%= l(:mail_body_lost_password) %>
|
||||||
|
<%= @url %>
|
|
@ -1,6 +1,4 @@
|
||||||
<%=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 />
|
<h1><%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to @message.subject, @message_url %></h1>
|
||||||
<em><%= @message.author.name %></em>
|
<em><%= @message.author.name %></em>
|
||||||
|
|
||||||
<%= textilizable @message.content %>
|
<%= textilizable @message.content %>
|
||||||
<hr />
|
|
||||||
<small><em><%= textilizable Setting.emails_footer %></em></small>
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'messages', :action => 'show', :board_id => @message.board_id, :id => @message.root %>
|
<%= @message_url %>
|
||||||
<%= @message.author.name %>
|
<%= @message.author.name %>
|
||||||
|
|
||||||
<%= @message.content %>
|
<%= @message.content %>
|
||||||
----------------------------------------
|
|
||||||
<%= Setting.emails_footer %>
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<%= link_to @news.title, :only_path => false, :host => Setting.host_name, :controller => 'news', :action => 'show', :id => @news %><br />
|
<h1><%= link_to @news.title, @news_url %></h1>
|
||||||
<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>
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<%= @news.title %>
|
<%= @news.title %>
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'news', :action => 'show', :id => @news %>
|
<%= @news_url %>
|
||||||
<%= @news.author.name %>
|
<%= @news.author.name %>
|
||||||
|
|
||||||
<%= @news.description %>
|
<%= @news.description %>
|
||||||
----------------------------------------
|
|
||||||
<%= Setting.emails_footer %>
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
<%= l(:mail_body_register) %>
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'register', :token => @token.value %>
|
|
||||||
|
|
||||||
----------------------------------------
|
|
||||||
<%= Setting.emails_footer %>
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
<p><%= l(:mail_body_register) %><br />
|
||||||
|
<%= auto_link(@url) %></p>
|
|
@ -0,0 +1,2 @@
|
||||||
|
<%= l(:mail_body_register) %>
|
||||||
|
<%= @url %>
|
|
@ -1,5 +1,2 @@
|
||||||
<p>This is a test email sent by Redmine.<br />
|
<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'),
|
Redmine URL: <%= auto_link(@url) %></p>
|
||||||
url_for(:only_path => false, :host => Setting.host_name, :controller => 'welcome') %></p>
|
|
||||||
<hr />
|
|
||||||
<small><em><%= textilizable Setting.emails_footer %></em></small>
|
|
||||||
|
|
|
@ -1,5 +1,2 @@
|
||||||
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 %>
|
||||||
|
|
||||||
----------------------------------------
|
|
||||||
<%= Setting.emails_footer %>
|
|
||||||
|
|
|
@ -37,6 +37,9 @@
|
||||||
<p><label><%= l(:setting_host_name) %></label>
|
<p><label><%= l(:setting_host_name) %></label>
|
||||||
<%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
|
<%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
|
||||||
|
|
||||||
|
<p><label><%= l(:setting_protocol) %></label>
|
||||||
|
<%= select_tag 'settings[protocol]', options_for_select(['http', 'https'], Setting.protocol) %></p>
|
||||||
|
|
||||||
<p><label><%= l(:setting_text_formatting) %></label>
|
<p><label><%= l(:setting_text_formatting) %></label>
|
||||||
<%= select_tag 'settings[text_formatting]', options_for_select([[l(:label_none), "0"], ["textile", "textile"]], Setting.text_formatting) %></p>
|
<%= select_tag 'settings[text_formatting]', options_for_select([[l(:label_none), "0"], ["textile", "textile"]], Setting.text_formatting) %></p>
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,8 @@ default_language:
|
||||||
default: en
|
default: en
|
||||||
host_name:
|
host_name:
|
||||||
default: localhost:3000
|
default: localhost:3000
|
||||||
|
protocol:
|
||||||
|
default: http
|
||||||
feeds_limit:
|
feeds_limit:
|
||||||
format: int
|
format: int
|
||||||
default: 15
|
default: 15
|
||||||
|
|
|
@ -534,3 +534,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -534,3 +534,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -534,3 +534,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -80,6 +80,8 @@ mail_subject_lost_password: Your Redmine password
|
||||||
mail_body_lost_password: 'To change your Redmine password, click on the following link:'
|
mail_body_lost_password: 'To change your Redmine password, click on the following link:'
|
||||||
mail_subject_register: Redmine account activation
|
mail_subject_register: Redmine account activation
|
||||||
mail_body_register: 'To activate your Redmine account, click on the following link:'
|
mail_body_register: 'To activate your Redmine account, click on the following link:'
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
|
||||||
gui_validation_error: 1 error
|
gui_validation_error: 1 error
|
||||||
gui_validation_error_plural: %d errors
|
gui_validation_error_plural: %d errors
|
||||||
|
@ -189,6 +191,7 @@ 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
|
setting_emails_footer: Emails footer
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
||||||
label_user: User
|
label_user: User
|
||||||
label_user_plural: Users
|
label_user_plural: Users
|
||||||
|
|
|
@ -537,3 +537,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -80,6 +80,8 @@ mail_subject_lost_password: Votre mot de passe redMine
|
||||||
mail_body_lost_password: 'Pour changer votre mot de passe Redmine, cliquez sur le lien suivant:'
|
mail_body_lost_password: 'Pour changer votre mot de passe Redmine, cliquez sur le lien suivant:'
|
||||||
mail_subject_register: Activation de votre compte redMine
|
mail_subject_register: Activation de votre compte redMine
|
||||||
mail_body_register: 'Pour activer votre compte Redmine, cliquez sur le lien suivant:'
|
mail_body_register: 'Pour activer votre compte Redmine, cliquez sur le lien suivant:'
|
||||||
|
mail_body_account_information_external: Vous pouvez utiliser votre compte "%s" pour vous connecter à Redmine.
|
||||||
|
mail_body_account_information: Paramètres de connexion de votre compte Redmine
|
||||||
|
|
||||||
gui_validation_error: 1 erreur
|
gui_validation_error: 1 erreur
|
||||||
gui_validation_error_plural: %d erreurs
|
gui_validation_error_plural: %d erreurs
|
||||||
|
@ -189,6 +191,7 @@ setting_cross_project_issue_relations: Autoriser les relations entre demandes de
|
||||||
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
|
setting_emails_footer: Pied-de-page des emails
|
||||||
|
setting_protocol: Protocole
|
||||||
|
|
||||||
label_user: Utilisateur
|
label_user: Utilisateur
|
||||||
label_user_plural: Utilisateurs
|
label_user_plural: Utilisateurs
|
||||||
|
|
|
@ -534,3 +534,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -534,3 +534,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -535,3 +535,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -535,3 +535,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -534,3 +534,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: Możesz użyć twojego "%s" konta do zalogowania do Redmine.
|
||||||
|
mail_body_account_information: Twoje konto w Redmine
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -534,3 +534,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -534,3 +534,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -534,3 +534,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -80,6 +80,8 @@ mail_subject_lost_password: Vaša redMine lozinka
|
||||||
mail_body_lost_password: 'Da biste izmenili vašu Redmine lozinku, kliknite na sledeći link:'
|
mail_body_lost_password: 'Da biste izmenili vašu Redmine lozinku, kliknite na sledeći link:'
|
||||||
mail_subject_register: aktivacija redMine naloga
|
mail_subject_register: aktivacija redMine naloga
|
||||||
mail_body_register: 'Da biste aktivirali vaš Redmine nalog, kliknite na sledeći link:'
|
mail_body_register: 'Da biste aktivirali vaš Redmine nalog, kliknite na sledeći link:'
|
||||||
|
mail_body_account_information_external: Mozete koristiti vas "%s" nalog da bi ste se prikljucili na Redmine.
|
||||||
|
mail_body_account_information: Informacije o vasem Redmine nalogu
|
||||||
|
|
||||||
gui_validation_error: 1 greška
|
gui_validation_error: 1 greška
|
||||||
gui_validation_error_plural: %d grešaka
|
gui_validation_error_plural: %d grešaka
|
||||||
|
@ -535,3 +537,4 @@ enumeration_doc_categories: Kategorija dokumenata
|
||||||
enumeration_activities: Aktivnosti (praćenje vremena))
|
enumeration_activities: Aktivnosti (praćenje vremena))
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -535,3 +535,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -537,3 +537,6 @@ label_user_mail_option_none: "Only for things I watch or I'm involved in"
|
||||||
setting_emails_footer: Emails footer
|
setting_emails_footer: Emails footer
|
||||||
label_float: Float
|
label_float: Float
|
||||||
button_copy: Copy
|
button_copy: Copy
|
||||||
|
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||||
|
mail_body_account_information: Your Redmine account information
|
||||||
|
setting_protocol: Protocol
|
||||||
|
|
|
@ -11,3 +11,16 @@ attachments_001:
|
||||||
filesize: 28
|
filesize: 28
|
||||||
filename: error281.txt
|
filename: error281.txt
|
||||||
author_id: 2
|
author_id: 2
|
||||||
|
attachments_002:
|
||||||
|
created_on: 2006-07-19 21:07:27 +02:00
|
||||||
|
downloads: 0
|
||||||
|
content_type: text/plain
|
||||||
|
disk_filename: 060719210727_document.txt
|
||||||
|
container_id: 1
|
||||||
|
digest: b91e08d0cf966d5c6ff411bd8c4cc3a2
|
||||||
|
id: 2
|
||||||
|
container_type: Document
|
||||||
|
filesize: 28
|
||||||
|
filename: document.txt
|
||||||
|
author_id: 2
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
require File.dirname(__FILE__) + '/../test_helper'
|
||||||
|
|
||||||
class MailerTest < Test::Unit::TestCase
|
class MailerTest < Test::Unit::TestCase
|
||||||
fixtures :projects, :issues, :users, :members, :documents, :attachments, :tokens, :journals, :journal_details, :trackers, :issue_statuses, :enumerations
|
fixtures :projects, :issues, :users, :members, :documents, :attachments, :news, :tokens, :journals, :journal_details, :trackers, :issue_statuses, :enumerations
|
||||||
|
|
||||||
# test mailer methods for each language
|
# test mailer methods for each language
|
||||||
def test_issue_add
|
def test_issue_add
|
||||||
|
@ -37,7 +37,7 @@ class MailerTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_document_add
|
def test_document_added
|
||||||
document = Document.find(1)
|
document = Document.find(1)
|
||||||
GLoc.valid_languages.each do |lang|
|
GLoc.valid_languages.each do |lang|
|
||||||
Setting.default_language = lang.to_s
|
Setting.default_language = lang.to_s
|
||||||
|
@ -45,10 +45,46 @@ class MailerTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_attachments_added
|
||||||
|
attachements = [ Attachment.find_by_container_type('Document') ]
|
||||||
|
GLoc.valid_languages.each do |lang|
|
||||||
|
Setting.default_language = lang.to_s
|
||||||
|
assert Mailer.deliver_attachments_added(attachements)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_news_added
|
||||||
|
news = News.find(:first)
|
||||||
|
GLoc.valid_languages.each do |lang|
|
||||||
|
Setting.default_language = lang.to_s
|
||||||
|
assert Mailer.deliver_news_added(news)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_message_posted
|
||||||
|
message = Message.find(:first)
|
||||||
|
recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author}
|
||||||
|
recipients = recipients.compact.uniq
|
||||||
|
GLoc.valid_languages.each do |lang|
|
||||||
|
Setting.default_language = lang.to_s
|
||||||
|
assert Mailer.deliver_message_posted(message, recipients)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_account_information
|
||||||
|
user = User.find(:first)
|
||||||
|
GLoc.valid_languages.each do |lang|
|
||||||
|
user.update_attribute :language, lang.to_s
|
||||||
|
user.reload
|
||||||
|
assert Mailer.deliver_account_information(user, 'pAsswORd')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_lost_password
|
def test_lost_password
|
||||||
token = Token.find(2)
|
token = Token.find(2)
|
||||||
GLoc.valid_languages.each do |lang|
|
GLoc.valid_languages.each do |lang|
|
||||||
token.user.update_attribute :language, lang.to_s
|
token.user.update_attribute :language, lang.to_s
|
||||||
|
token.reload
|
||||||
assert Mailer.deliver_lost_password(token)
|
assert Mailer.deliver_lost_password(token)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -57,6 +93,7 @@ class MailerTest < Test::Unit::TestCase
|
||||||
token = Token.find(1)
|
token = Token.find(1)
|
||||||
GLoc.valid_languages.each do |lang|
|
GLoc.valid_languages.each do |lang|
|
||||||
token.user.update_attribute :language, lang.to_s
|
token.user.update_attribute :language, lang.to_s
|
||||||
|
token.reload
|
||||||
assert Mailer.deliver_register(token)
|
assert Mailer.deliver_register(token)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue