##// END OF EJS Templates
Mailer:...
Jean-Philippe Lang -
r864:bd434427e61e
parent child
Show More
@@ -0,0 +1,11
1 <% if @user.auth_source %>
2 <p><%= l(:mail_body_account_information_external, @user.auth_source.name) %></p>
3 <% else %>
4 <p><%= l(:mail_body_account_information) %>:</p>
5 <ul>
6 <li><%= l(:field_login) %>: <%= @user.login %></li>
7 <li><%= l(:field_password) %>: <%= @password %></li>
8 </ul>
9 <% end %>
10
11 <p><%= l(:label_login) %>: <%= auto_link(@login_url) %></p>
@@ -0,0 +1,6
1 <% if @user.auth_source %><%= l(:mail_body_account_information_external, @user.auth_source.name) %>
2 <% else %><%= l(:mail_body_account_information) %>:
3 * <%= l(:field_login) %>: <%= @user.login %>
4 * <%= l(:field_password) %>: <%= @password %>
5 <% end %>
6 <%= l(:label_login) %>: <%= @login_url %>
@@ -0,0 +1,17
1 <html>
2 <head>
3 <style>
4 body { font-family: Verdana, sans-serif; font-size: 0.8em; color:#484848; }
5 body h1 { font-family: "Trebuchet MS", Verdana, sans-serif; font-size: 1.2em; margin: 0;}
6 a, a:link, a:visited{ color: #2A5685; }
7 a:hover, a:active{ color: #c61a1a; }
8 hr { width: 100%; height: 1px; background: #ccc; border: 0; }
9 .footer { font-size: 0.8em; font-style: italic; }
10 </style>
11 </head>
12 <body>
13 <%= yield %>
14 <hr />
15 <span class="footer"><%= Redmine::WikiFormatting.to_html(Setting.emails_footer) %></span>
16 </body>
17 </html>
@@ -0,0 +1,2
1 <p><%= l(:mail_body_lost_password) %><br />
2 <%= auto_link(@url) %></p>
@@ -0,0 +1,2
1 <%= l(:mail_body_lost_password) %>
2 <%= @url %>
@@ -0,0 +1,2
1 <p><%= l(:mail_body_register) %><br />
2 <%= auto_link(@url) %></p>
@@ -0,0 +1,2
1 <%= l(:mail_body_register) %>
2 <%= @url %>
@@ -20,99 +20,111 class Mailer < ActionMailer::Base
20 helper IssuesHelper
20 helper IssuesHelper
21 helper CustomFieldsHelper
21 helper CustomFieldsHelper
22
22
23 def account_information(user, password)
23 include ActionController::UrlWriter
24 set_language_if_valid user.language
24
25 recipients user.mail
25 def issue_add(issue)
26 from Setting.mail_from
26 recipients issue.recipients
27 subject l(:mail_subject_register)
27 subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
28 body :user => user, :password => password
28 body :issue => issue,
29 end
29 :issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
30
31 def issue_add(issue)
32 set_language_if_valid(Setting.default_language)
33 @recipients = issue.recipients
34 @from = Setting.mail_from
35 @subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
36 @body['issue'] = issue
37 end
30 end
38
31
39 def issue_edit(journal)
32 def issue_edit(journal)
40 set_language_if_valid(Setting.default_language)
41 issue = journal.journalized
33 issue = journal.journalized
42 @recipients = issue.recipients
34 recipients issue.recipients
43 # Watchers in cc
35 # Watchers in cc
44 @cc = issue.watcher_recipients - @recipients
36 cc(issue.watcher_recipients - @recipients)
45 @from = Setting.mail_from
37 subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
46 @subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
38 body :issue => issue,
47 @body['issue'] = issue
39 :journal => journal,
48 @body['journal']= journal
40 :issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
49 end
41 end
50
42
51 def document_added(document)
43 def document_added(document)
52 set_language_if_valid(Setting.default_language)
44 recipients document.project.recipients
53 @recipients = document.project.recipients
45 subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
54 @from = Setting.mail_from
46 body :document => document,
55 @subject = "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
47 :document_url => url_for(:controller => 'documents', :action => 'show', :id => document)
56 @body['document'] = document
57 end
48 end
58
49
59 def attachments_added(attachments)
50 def attachments_added(attachments)
60 set_language_if_valid(Setting.default_language)
61 container = attachments.first.container
51 container = attachments.first.container
62 url = ''
63 added_to = ''
52 added_to = ''
53 added_to_url = ''
64 case container.class.name
54 case container.class.name
65 when 'Version'
55 when 'Version'
66 url = {:only_path => false, :host => Setting.host_name, :controller => 'projects', :action => 'list_files', :id => container.project_id}
56 added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container.project_id)
67 added_to = "#{l(:label_version)}: #{container.name}"
57 added_to = "#{l(:label_version)}: #{container.name}"
68 when 'Document'
58 when 'Document'
69 url = {:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id}
59 added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id)
70 added_to = "#{l(:label_document)}: #{container.title}"
60 added_to = "#{l(:label_document)}: #{container.title}"
71 end
61 end
72 @recipients = container.project.recipients
62 recipients container.project.recipients
73 @from = Setting.mail_from
63 subject "[#{container.project.name}] #{l(:label_attachment_new)}"
74 @subject = "[#{container.project.name}] #{l(:label_attachment_new)}"
64 body :attachments => attachments,
75 @body['attachments'] = attachments
65 :added_to => added_to,
76 @body['url'] = url
66 :added_to_url => added_to_url
77 @body['added_to'] = added_to
78 end
67 end
79
68
80 def news_added(news)
69 def news_added(news)
81 set_language_if_valid(Setting.default_language)
70 recipients news.project.recipients
82 @recipients = news.project.recipients
71 subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
83 @from = Setting.mail_from
72 body :news => news,
84 @subject = "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
73 :news_url => url_for(:controller => 'news', :action => 'show', :id => news)
85 @body['news'] = news
86 end
74 end
87
75
76 def message_posted(message, recipients)
77 recipients(recipients)
78 subject "[#{message.board.project.name} - #{message.board.name}] #{message.subject}"
79 body :message => message,
80 :message_url => url_for(:controller => 'messages', :action => 'show', :board_id => message.board_id, :id => message.root)
81 end
82
83 def account_information(user, password)
84 set_language_if_valid user.language
85 recipients user.mail
86 subject l(:mail_subject_register)
87 body :user => user,
88 :password => password,
89 :login_url => url_for(:controller => 'account', :action => 'login')
90 end
91
88 def lost_password(token)
92 def lost_password(token)
89 set_language_if_valid(token.user.language)
93 set_language_if_valid(token.user.language)
90 @recipients = token.user.mail
94 recipients token.user.mail
91 @from = Setting.mail_from
95 subject l(:mail_subject_lost_password)
92 @subject = l(:mail_subject_lost_password)
96 body :token => token,
93 @body['token'] = token
97 :url => url_for(:controller => 'account', :action => 'lost_password', :token => token.value)
94 end
98 end
95
99
96 def register(token)
100 def register(token)
97 set_language_if_valid(token.user.language)
101 set_language_if_valid(token.user.language)
98 @recipients = token.user.mail
102 recipients token.user.mail
99 @from = Setting.mail_from
103 subject l(:mail_subject_register)
100 @subject = l(:mail_subject_register)
104 body :token => token,
101 @body['token'] = token
105 :url => url_for(:controller => 'account', :action => 'register', :token => token.value)
102 end
103
104 def message_posted(message, recipients)
105 set_language_if_valid(Setting.default_language)
106 @recipients = recipients
107 @from = Setting.mail_from
108 @subject = "[#{message.board.project.name} - #{message.board.name}] #{message.subject}"
109 @body['message'] = message
110 end
106 end
111
107
112 def test(user)
108 def test(user)
113 set_language_if_valid(user.language)
109 set_language_if_valid(user.language)
114 @recipients = user.mail
110 recipients user.mail
115 @from = Setting.mail_from
111 subject 'Redmine test'
116 @subject = 'Redmine'
112 body :url => url_for(:controller => 'welcome')
113 end
114
115 private
116 def initialize_defaults(method_name)
117 super
118 set_language_if_valid Setting.default_language
119 from Setting.mail_from
120 default_url_options[:host] = Setting.host_name
121 default_url_options[:protocol] = Setting.protocol
122 end
123
124 # Renders a message with the corresponding layout
125 def render_message(method_name, body)
126 layout = method_name.match(%r{text\.html\.(rhtml|rxml)}) ? 'layout.text.html.rhtml' : 'layout.text.plain.rhtml'
127 body[:content_for_layout] = render(:file => method_name, :body => body)
128 ActionView::Base.new(File.join(template_root, 'mailer'), body, self).render(:file => layout)
117 end
129 end
118 end
130 end
@@ -1,5 +1,4
1 <%= link_to "#{issue.tracker.name} ##{issue.id}", :only_path => false, :host => Setting.host_name, :controller => 'issues', :action => 'show', :id => issue %>:
1 <h1><%= link_to "#{issue.tracker.name} ##{issue.id}: #{issue.subject}", issue_url %></h1>
2 <%= issue.subject %>
3
2
4 <ul>
3 <ul>
5 <li><%=l(:field_author)%>: <%= issue.author %></li>
4 <li><%=l(:field_author)%>: <%= issue.author %></li>
@@ -1,5 +1,5
1 <%= "#{issue.tracker.name} ##{issue.id}: #{issue.subject}" %>
1 <%= "#{issue.tracker.name} ##{issue.id}: #{issue.subject}" %>
2 <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'issues', :action => 'show', :id => issue %>
2 <%= issue_url %>
3
3
4 <%=l(:field_author)%>: <%= issue.author %>
4 <%=l(:field_author)%>: <%= issue.author %>
5 <%=l(:field_status)%>: <%= issue.status %>
5 <%=l(:field_status)%>: <%= issue.status %>
@@ -1,7 +1,5
1 <%= link_to @added_to, @url %><br />
1 <%= link_to @added_to, @added_to_url %><br />
2
2
3 <ul><% @attachments.each do |attachment | %>
3 <ul><% @attachments.each do |attachment | %>
4 <li><%= attachment.filename %></li>
4 <li><%= attachment.filename %></li>
5 <% end %></ul>
5 <% end %></ul>
6 <hr />
7 <small><em><%= textilizable Setting.emails_footer %></em></small>
@@ -1,6 +1,4
1 <%= @added_to %><% @attachments.each do |attachment | %>
1 <%= @added_to %><% @attachments.each do |attachment | %>
2 - <%= attachment.filename %><% end %>
2 - <%= attachment.filename %><% end %>
3
3
4 <%= url_for @url %>
4 <%= @added_to_url %>
5 ----------------------------------------
6 <%= Setting.emails_footer %>
@@ -1,6 +1,3
1 <%= link_to @document.title, :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
1 <%= link_to @document.title, @document_url %> (<%= @document.category.name %>)<br />
2 (<%= @document.category.name %>)<br />
3 <br />
2 <br />
4 <%= textilizable(@document.description) %>
3 <%= textilizable(@document.description) %>
5 <hr />
6 <small><em><%= textilizable Setting.emails_footer %></em></small>
@@ -1,6 +1,4
1 <%= @document.title %> (<%= @document.category.name %>)
1 <%= @document.title %> (<%= @document.category.name %>)
2 <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
2 <%= @document_url %>
3
3
4 <%= @document.description %>
4 <%= @document.description %>
5 ----------------------------------------
6 <%= Setting.emails_footer %>
@@ -1,5 +1,3
1 <%= l(:text_issue_added, "##{@issue.id}") %>
1 <%= l(:text_issue_added, "##{@issue.id}") %>
2 <hr />
2 <hr />
3 <%= render :file => "_issue_text_html", :use_full_path => true, :locals => { :issue => @issue } %>
3 <%= render :file => "_issue_text_html", :use_full_path => true, :locals => { :issue => @issue, :issue_url => @issue_url } %>
4 <hr />
5 <small><em><%= textilizable Setting.emails_footer %></em></small>
@@ -1,5 +1,3
1 <%= l(:text_issue_added, "##{@issue.id}") %>
1 <%= l(:text_issue_added, "##{@issue.id}") %>
2 ----------------------------------------
2 ----------------------------------------
3 <%= render :file => "_issue_text_plain", :use_full_path => true, :locals => { :issue => @issue } %>
3 <%= render :file => "_issue_text_plain", :use_full_path => true, :locals => { :issue => @issue, :issue_url => @issue_url } %>
4 ----------------------------------------
5 <%= Setting.emails_footer %>
@@ -7,6 +7,4
7 </ul>
7 </ul>
8 <%= textilizable(@journal.notes) %>
8 <%= textilizable(@journal.notes) %>
9 <hr />
9 <hr />
10 <%= render :file => "_issue_text_html", :use_full_path => true, :locals => { :issue => @issue } %>
10 <%= render :file => "_issue_text_html", :use_full_path => true, :locals => { :issue => @issue, :issue_url => @issue_url } %>
11 <hr />
12 <small><em><%= textilizable Setting.emails_footer %></em></small>
@@ -5,6 +5,4
5 <% end %>
5 <% end %>
6 <%= @journal.notes if @journal.notes? %>
6 <%= @journal.notes if @journal.notes? %>
7 ----------------------------------------
7 ----------------------------------------
8 <%= render :file => "_issue_text_plain", :use_full_path => true, :locals => { :issue => @issue } %>
8 <%= render :file => "_issue_text_plain", :use_full_path => true, :locals => { :issue => @issue, :issue_url => @issue_url } %>
9 ----------------------------------------
10 <%= Setting.emails_footer %>
@@ -1,5 +1,3
1 <%= l(:mail_body_lost_password) %>
1 <%= yield %>
2 <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'lost_password', :token => @token.value %>
3
4 ----------------------------------------
2 ----------------------------------------
5 <%= Setting.emails_footer %>
3 <%= Setting.emails_footer %>
@@ -1,6 +1,4
1 <%=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 />
1 <h1><%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to @message.subject, @message_url %></h1>
2 <em><%= @message.author.name %></em>
2 <em><%= @message.author.name %></em>
3
3
4 <%= textilizable @message.content %>
4 <%= textilizable @message.content %>
5 <hr />
6 <small><em><%= textilizable Setting.emails_footer %></em></small>
@@ -1,6 +1,4
1 <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'messages', :action => 'show', :board_id => @message.board_id, :id => @message.root %>
1 <%= @message_url %>
2 <%= @message.author.name %>
2 <%= @message.author.name %>
3
3
4 <%= @message.content %>
4 <%= @message.content %>
5 ----------------------------------------
6 <%= Setting.emails_footer %>
@@ -1,6 +1,4
1 <%= link_to @news.title, :only_path => false, :host => Setting.host_name, :controller => 'news', :action => 'show', :id => @news %><br />
1 <h1><%= link_to @news.title, @news_url %></h1>
2 <em><%= @news.author.name %></em>
2 <em><%= @news.author.name %></em>
3
3
4 <%= textilizable(@news.description) %>
4 <%= textilizable(@news.description) %>
5 <hr />
6 <small><em><%= textilizable Setting.emails_footer %></em></small>
@@ -1,7 +1,5
1 <%= @news.title %>
1 <%= @news.title %>
2 <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'news', :action => 'show', :id => @news %>
2 <%= @news_url %>
3 <%= @news.author.name %>
3 <%= @news.author.name %>
4
4
5 <%= @news.description %>
5 <%= @news.description %>
6 ----------------------------------------
7 <%= Setting.emails_footer %>
@@ -1,5 +1,2
1 <p>This is a test email sent by Redmine.<br />
1 <p>This is a test email sent by Redmine.<br />
2 Redmine URL: <%= link_to url_for(:only_path => false, :host => Setting.host_name, :controller => 'welcome'),
2 Redmine URL: <%= auto_link(@url) %></p>
3 url_for(:only_path => false, :host => Setting.host_name, :controller => 'welcome') %></p>
4 <hr />
5 <small><em><%= textilizable Setting.emails_footer %></em></small>
@@ -1,5 +1,2
1 This is a test email sent by Redmine.
1 This is a test email sent by Redmine.
2 Redmine URL: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'welcome' %>
2 Redmine URL: <%= @url %>
3
4 ----------------------------------------
5 <%= Setting.emails_footer %>
@@ -37,6 +37,9
37 <p><label><%= l(:setting_host_name) %></label>
37 <p><label><%= l(:setting_host_name) %></label>
38 <%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
38 <%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
39
39
40 <p><label><%= l(:setting_protocol) %></label>
41 <%= select_tag 'settings[protocol]', options_for_select(['http', 'https'], Setting.protocol) %></p>
42
40 <p><label><%= l(:setting_text_formatting) %></label>
43 <p><label><%= l(:setting_text_formatting) %></label>
41 <%= select_tag 'settings[text_formatting]', options_for_select([[l(:label_none), "0"], ["textile", "textile"]], Setting.text_formatting) %></p>
44 <%= select_tag 'settings[text_formatting]', options_for_select([[l(:label_none), "0"], ["textile", "textile"]], Setting.text_formatting) %></p>
42
45
@@ -91,4 +94,4
91
94
92 <%= submit_tag l(:button_save) %>
95 <%= submit_tag l(:button_save) %>
93 </div>
96 </div>
94 <% end %> No newline at end of file
97 <% end %>
@@ -47,6 +47,8 default_language:
47 default: en
47 default: en
48 host_name:
48 host_name:
49 default: localhost:3000
49 default: localhost:3000
50 protocol:
51 default: http
50 feeds_limit:
52 feeds_limit:
51 format: int
53 format: int
52 default: 15
54 default: 15
@@ -534,3 +534,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
534 setting_emails_footer: Emails footer
534 setting_emails_footer: Emails footer
535 label_float: Float
535 label_float: Float
536 button_copy: Copy
536 button_copy: Copy
537 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
538 mail_body_account_information: Your Redmine account information
539 setting_protocol: Protocol
@@ -534,3 +534,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
534 setting_emails_footer: Emails footer
534 setting_emails_footer: Emails footer
535 label_float: Float
535 label_float: Float
536 button_copy: Copy
536 button_copy: Copy
537 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
538 mail_body_account_information: Your Redmine account information
539 setting_protocol: Protocol
@@ -534,3 +534,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
534 setting_emails_footer: Emails footer
534 setting_emails_footer: Emails footer
535 label_float: Float
535 label_float: Float
536 button_copy: Copy
536 button_copy: Copy
537 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
538 mail_body_account_information: Your Redmine account information
539 setting_protocol: Protocol
@@ -80,6 +80,8 mail_subject_lost_password: Your Redmine password
80 mail_body_lost_password: 'To change your Redmine password, click on the following link:'
80 mail_body_lost_password: 'To change your Redmine password, click on the following link:'
81 mail_subject_register: Redmine account activation
81 mail_subject_register: Redmine account activation
82 mail_body_register: 'To activate your Redmine account, click on the following link:'
82 mail_body_register: 'To activate your Redmine account, click on the following link:'
83 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
84 mail_body_account_information: Your Redmine account information
83
85
84 gui_validation_error: 1 error
86 gui_validation_error: 1 error
85 gui_validation_error_plural: %d errors
87 gui_validation_error_plural: %d errors
@@ -189,6 +191,7 setting_cross_project_issue_relations: Allow cross-project issue relations
189 setting_issue_list_default_columns: Default columns displayed on the issue list
191 setting_issue_list_default_columns: Default columns displayed on the issue list
190 setting_repositories_encodings: Repositories encodings
192 setting_repositories_encodings: Repositories encodings
191 setting_emails_footer: Emails footer
193 setting_emails_footer: Emails footer
194 setting_protocol: Protocol
192
195
193 label_user: User
196 label_user: User
194 label_user_plural: Users
197 label_user_plural: Users
@@ -537,3 +537,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
537 setting_emails_footer: Emails footer
537 setting_emails_footer: Emails footer
538 label_float: Float
538 label_float: Float
539 button_copy: Copy
539 button_copy: Copy
540 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
541 mail_body_account_information: Your Redmine account information
542 setting_protocol: Protocol
@@ -80,6 +80,8 mail_subject_lost_password: Votre mot de passe redMine
80 mail_body_lost_password: 'Pour changer votre mot de passe Redmine, cliquez sur le lien suivant:'
80 mail_body_lost_password: 'Pour changer votre mot de passe Redmine, cliquez sur le lien suivant:'
81 mail_subject_register: Activation de votre compte redMine
81 mail_subject_register: Activation de votre compte redMine
82 mail_body_register: 'Pour activer votre compte Redmine, cliquez sur le lien suivant:'
82 mail_body_register: 'Pour activer votre compte Redmine, cliquez sur le lien suivant:'
83 mail_body_account_information_external: Vous pouvez utiliser votre compte "%s" pour vous connecter à Redmine.
84 mail_body_account_information: Paramètres de connexion de votre compte Redmine
83
85
84 gui_validation_error: 1 erreur
86 gui_validation_error: 1 erreur
85 gui_validation_error_plural: %d erreurs
87 gui_validation_error_plural: %d erreurs
@@ -189,6 +191,7 setting_cross_project_issue_relations: Autoriser les relations entre demandes de
189 setting_issue_list_default_columns: Colonnes affichées par défaut sur la liste des demandes
191 setting_issue_list_default_columns: Colonnes affichées par défaut sur la liste des demandes
190 setting_repositories_encodings: Encodages des dépôts
192 setting_repositories_encodings: Encodages des dépôts
191 setting_emails_footer: Pied-de-page des emails
193 setting_emails_footer: Pied-de-page des emails
194 setting_protocol: Protocole
192
195
193 label_user: Utilisateur
196 label_user: Utilisateur
194 label_user_plural: Utilisateurs
197 label_user_plural: Utilisateurs
@@ -534,3 +534,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
534 setting_emails_footer: Emails footer
534 setting_emails_footer: Emails footer
535 label_float: Float
535 label_float: Float
536 button_copy: Copy
536 button_copy: Copy
537 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
538 mail_body_account_information: Your Redmine account information
539 setting_protocol: Protocol
@@ -534,3 +534,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
534 setting_emails_footer: Emails footer
534 setting_emails_footer: Emails footer
535 label_float: Float
535 label_float: Float
536 button_copy: Copy
536 button_copy: Copy
537 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
538 mail_body_account_information: Your Redmine account information
539 setting_protocol: Protocol
@@ -535,3 +535,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
535 setting_emails_footer: Emails footer
535 setting_emails_footer: Emails footer
536 label_float: Float
536 label_float: Float
537 button_copy: Copy
537 button_copy: Copy
538 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
539 mail_body_account_information: Your Redmine account information
540 setting_protocol: Protocol
@@ -535,3 +535,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
535 setting_emails_footer: Emails footer
535 setting_emails_footer: Emails footer
536 label_float: Float
536 label_float: Float
537 button_copy: Copy
537 button_copy: Copy
538 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
539 mail_body_account_information: Your Redmine account information
540 setting_protocol: Protocol
@@ -534,3 +534,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
534 setting_emails_footer: Emails footer
534 setting_emails_footer: Emails footer
535 label_float: Float
535 label_float: Float
536 button_copy: Copy
536 button_copy: Copy
537 mail_body_account_information_external: Możesz użyć twojego "%s" konta do zalogowania do Redmine.
538 mail_body_account_information: Twoje konto w Redmine
539 setting_protocol: Protocol
@@ -534,3 +534,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
534 setting_emails_footer: Emails footer
534 setting_emails_footer: Emails footer
535 label_float: Float
535 label_float: Float
536 button_copy: Copy
536 button_copy: Copy
537 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
538 mail_body_account_information: Your Redmine account information
539 setting_protocol: Protocol
@@ -534,3 +534,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
534 setting_emails_footer: Emails footer
534 setting_emails_footer: Emails footer
535 label_float: Float
535 label_float: Float
536 button_copy: Copy
536 button_copy: Copy
537 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
538 mail_body_account_information: Your Redmine account information
539 setting_protocol: Protocol
@@ -534,3 +534,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
534 setting_emails_footer: Emails footer
534 setting_emails_footer: Emails footer
535 label_float: Float
535 label_float: Float
536 button_copy: Copy
536 button_copy: Copy
537 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
538 mail_body_account_information: Your Redmine account information
539 setting_protocol: Protocol
@@ -80,6 +80,8 mail_subject_lost_password: Vaša redMine lozinka
80 mail_body_lost_password: 'Da biste izmenili vašu Redmine lozinku, kliknite na sledeći link:'
80 mail_body_lost_password: 'Da biste izmenili vašu Redmine lozinku, kliknite na sledeći link:'
81 mail_subject_register: aktivacija redMine naloga
81 mail_subject_register: aktivacija redMine naloga
82 mail_body_register: 'Da biste aktivirali vaš Redmine nalog, kliknite na sledeći link:'
82 mail_body_register: 'Da biste aktivirali vaš Redmine nalog, kliknite na sledeći link:'
83 mail_body_account_information_external: Mozete koristiti vas "%s" nalog da bi ste se prikljucili na Redmine.
84 mail_body_account_information: Informacije o vasem Redmine nalogu
83
85
84 gui_validation_error: 1 greška
86 gui_validation_error: 1 greška
85 gui_validation_error_plural: %d grešaka
87 gui_validation_error_plural: %d grešaka
@@ -535,3 +537,4 enumeration_doc_categories: Kategorija dokumenata
535 enumeration_activities: Aktivnosti (praćenje vremena))
537 enumeration_activities: Aktivnosti (praćenje vremena))
536 label_float: Float
538 label_float: Float
537 button_copy: Copy
539 button_copy: Copy
540 setting_protocol: Protocol
@@ -535,3 +535,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
535 setting_emails_footer: Emails footer
535 setting_emails_footer: Emails footer
536 label_float: Float
536 label_float: Float
537 button_copy: Copy
537 button_copy: Copy
538 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
539 mail_body_account_information: Your Redmine account information
540 setting_protocol: Protocol
@@ -537,3 +537,6 label_user_mail_option_none: "Only for things I watch or I'm involved in"
537 setting_emails_footer: Emails footer
537 setting_emails_footer: Emails footer
538 label_float: Float
538 label_float: Float
539 button_copy: Copy
539 button_copy: Copy
540 mail_body_account_information_external: You can use your "%s" account to log into Redmine.
541 mail_body_account_information: Your Redmine account information
542 setting_protocol: Protocol
@@ -11,3 +11,16 attachments_001:
11 filesize: 28
11 filesize: 28
12 filename: error281.txt
12 filename: error281.txt
13 author_id: 2
13 author_id: 2
14 attachments_002:
15 created_on: 2006-07-19 21:07:27 +02:00
16 downloads: 0
17 content_type: text/plain
18 disk_filename: 060719210727_document.txt
19 container_id: 1
20 digest: b91e08d0cf966d5c6ff411bd8c4cc3a2
21 id: 2
22 container_type: Document
23 filesize: 28
24 filename: document.txt
25 author_id: 2
26 No newline at end of file
@@ -18,7 +18,7
18 require File.dirname(__FILE__) + '/../test_helper'
18 require File.dirname(__FILE__) + '/../test_helper'
19
19
20 class MailerTest < Test::Unit::TestCase
20 class MailerTest < Test::Unit::TestCase
21 fixtures :projects, :issues, :users, :members, :documents, :attachments, :tokens, :journals, :journal_details, :trackers, :issue_statuses, :enumerations
21 fixtures :projects, :issues, :users, :members, :documents, :attachments, :news, :tokens, :journals, :journal_details, :trackers, :issue_statuses, :enumerations
22
22
23 # test mailer methods for each language
23 # test mailer methods for each language
24 def test_issue_add
24 def test_issue_add
@@ -37,18 +37,54 class MailerTest < Test::Unit::TestCase
37 end
37 end
38 end
38 end
39
39
40 def test_document_add
40 def test_document_added
41 document = Document.find(1)
41 document = Document.find(1)
42 GLoc.valid_languages.each do |lang|
42 GLoc.valid_languages.each do |lang|
43 Setting.default_language = lang.to_s
43 Setting.default_language = lang.to_s
44 assert Mailer.deliver_document_added(document)
44 assert Mailer.deliver_document_added(document)
45 end
45 end
46 end
46 end
47
48 def test_attachments_added
49 attachements = [ Attachment.find_by_container_type('Document') ]
50 GLoc.valid_languages.each do |lang|
51 Setting.default_language = lang.to_s
52 assert Mailer.deliver_attachments_added(attachements)
53 end
54 end
55
56 def test_news_added
57 news = News.find(:first)
58 GLoc.valid_languages.each do |lang|
59 Setting.default_language = lang.to_s
60 assert Mailer.deliver_news_added(news)
61 end
62 end
63
64 def test_message_posted
65 message = Message.find(:first)
66 recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author}
67 recipients = recipients.compact.uniq
68 GLoc.valid_languages.each do |lang|
69 Setting.default_language = lang.to_s
70 assert Mailer.deliver_message_posted(message, recipients)
71 end
72 end
73
74 def test_account_information
75 user = User.find(:first)
76 GLoc.valid_languages.each do |lang|
77 user.update_attribute :language, lang.to_s
78 user.reload
79 assert Mailer.deliver_account_information(user, 'pAsswORd')
80 end
81 end
47
82
48 def test_lost_password
83 def test_lost_password
49 token = Token.find(2)
84 token = Token.find(2)
50 GLoc.valid_languages.each do |lang|
85 GLoc.valid_languages.each do |lang|
51 token.user.update_attribute :language, lang.to_s
86 token.user.update_attribute :language, lang.to_s
87 token.reload
52 assert Mailer.deliver_lost_password(token)
88 assert Mailer.deliver_lost_password(token)
53 end
89 end
54 end
90 end
@@ -57,7 +93,8 class MailerTest < Test::Unit::TestCase
57 token = Token.find(1)
93 token = Token.find(1)
58 GLoc.valid_languages.each do |lang|
94 GLoc.valid_languages.each do |lang|
59 token.user.update_attribute :language, lang.to_s
95 token.user.update_attribute :language, lang.to_s
96 token.reload
60 assert Mailer.deliver_register(token)
97 assert Mailer.deliver_register(token)
61 end
98 end
62 end
99 end
63 end No newline at end of file
100 end
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now