##// END OF EJS Templates
change mailer model method comments to Rails3 style...
Toshi MARUYAMA -
r9480:0bb937152b7e
parent child
Show More
@@ -27,11 +27,11 class Mailer < ActionMailer::Base
27 { :host => Setting.host_name, :protocol => Setting.protocol }
27 { :host => Setting.host_name, :protocol => Setting.protocol }
28 end
28 end
29
29
30 # Builds a tmail object used to email recipients of the added issue.
30 # Builds a Mail::Message object used to email recipients of the added issue.
31 #
31 #
32 # Example:
32 # Example:
33 # issue_add(issue) => tmail object
33 # issue_add(issue) => Mail::Message object
34 # Mailer.deliver_issue_add(issue) => sends an email to issue recipients
34 # Mailer.issue_add(issue).deliver => sends an email to issue recipients
35 def issue_add(issue)
35 def issue_add(issue)
36 redmine_headers 'Project' => issue.project.identifier,
36 redmine_headers 'Project' => issue.project.identifier,
37 'Issue-Id' => issue.id,
37 'Issue-Id' => issue.id,
@@ -48,11 +48,11 class Mailer < ActionMailer::Base
48 :subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
48 :subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
49 end
49 end
50
50
51 # Builds a tmail object used to email recipients of the edited issue.
51 # Builds a Mail::Message object used to email recipients of the edited issue.
52 #
52 #
53 # Example:
53 # Example:
54 # issue_edit(journal) => tmail object
54 # issue_edit(journal) => Mail::Message object
55 # Mailer.deliver_issue_edit(journal) => sends an email to issue recipients
55 # Mailer.issue_edit(journal).deliver => sends an email to issue recipients
56 def issue_edit(journal)
56 def issue_edit(journal)
57 issue = journal.journalized.reload
57 issue = journal.journalized.reload
58 redmine_headers 'Project' => issue.project.identifier,
58 redmine_headers 'Project' => issue.project.identifier,
@@ -87,11 +87,11 class Mailer < ActionMailer::Base
87 :subject => l(:mail_subject_reminder, :count => issues.size, :days => days)
87 :subject => l(:mail_subject_reminder, :count => issues.size, :days => days)
88 end
88 end
89
89
90 # Builds a tmail object used to email users belonging to the added document's project.
90 # Builds a Mail::Message object used to email users belonging to the added document's project.
91 #
91 #
92 # Example:
92 # Example:
93 # document_added(document) => tmail object
93 # document_added(document) => Mail::Message object
94 # Mailer.deliver_document_added(document) => sends an email to the document's project recipients
94 # Mailer.document_added(document).deliver => sends an email to the document's project recipients
95 def document_added(document)
95 def document_added(document)
96 redmine_headers 'Project' => document.project.identifier
96 redmine_headers 'Project' => document.project.identifier
97 @author = User.current
97 @author = User.current
@@ -101,11 +101,11 class Mailer < ActionMailer::Base
101 :subject => "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
101 :subject => "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
102 end
102 end
103
103
104 # Builds a tmail object used to email recipients of a project when an attachements are added.
104 # Builds a Mail::Message object used to email recipients of a project when an attachements are added.
105 #
105 #
106 # Example:
106 # Example:
107 # attachments_added(attachments) => tmail object
107 # attachments_added(attachments) => Mail::Message object
108 # Mailer.deliver_attachments_added(attachments) => sends an email to the project's recipients
108 # Mailer.attachments_added(attachments).deliver => sends an email to the project's recipients
109 def attachments_added(attachments)
109 def attachments_added(attachments)
110 container = attachments.first.container
110 container = attachments.first.container
111 added_to = ''
111 added_to = ''
@@ -133,11 +133,11 class Mailer < ActionMailer::Base
133 :subject => "[#{container.project.name}] #{l(:label_attachment_new)}"
133 :subject => "[#{container.project.name}] #{l(:label_attachment_new)}"
134 end
134 end
135
135
136 # Builds a tmail object used to email recipients of a news' project when a news item is added.
136 # Builds a Mail::Message object used to email recipients of a news' project when a news item is added.
137 #
137 #
138 # Example:
138 # Example:
139 # news_added(news) => tmail object
139 # news_added(news) => Mail::Message object
140 # Mailer.deliver_news_added(news) => sends an email to the news' project recipients
140 # Mailer.news_added(news).deliver => sends an email to the news' project recipients
141 def news_added(news)
141 def news_added(news)
142 redmine_headers 'Project' => news.project.identifier
142 redmine_headers 'Project' => news.project.identifier
143 @author = news.author
143 @author = news.author
@@ -148,10 +148,10 class Mailer < ActionMailer::Base
148 :subject => "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
148 :subject => "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
149 end
149 end
150
150
151 # Builds a tmail object used to email recipients of a news' project when a news comment is added.
151 # Builds a Mail::Message object used to email recipients of a news' project when a news comment is added.
152 #
152 #
153 # Example:
153 # Example:
154 # news_comment_added(comment) => tmail object
154 # news_comment_added(comment) => Mail::Message object
155 # Mailer.news_comment_added(comment) => sends an email to the news' project recipients
155 # Mailer.news_comment_added(comment) => sends an email to the news' project recipients
156 def news_comment_added(comment)
156 def news_comment_added(comment)
157 news = comment.commented
157 news = comment.commented
@@ -166,11 +166,11 class Mailer < ActionMailer::Base
166 :subject => "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}"
166 :subject => "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}"
167 end
167 end
168
168
169 # Builds a tmail object used to email the recipients of the specified message that was posted.
169 # Builds a Mail::Message object used to email the recipients of the specified message that was posted.
170 #
170 #
171 # Example:
171 # Example:
172 # message_posted(message) => tmail object
172 # message_posted(message) => Mail::Message object
173 # Mailer.deliver_message_posted(message) => sends an email to the recipients
173 # Mailer.message_posted(message).deliver => sends an email to the recipients
174 def message_posted(message)
174 def message_posted(message)
175 redmine_headers 'Project' => message.project.identifier,
175 redmine_headers 'Project' => message.project.identifier,
176 'Topic-Id' => (message.parent_id || message.id)
176 'Topic-Id' => (message.parent_id || message.id)
@@ -186,11 +186,11 class Mailer < ActionMailer::Base
186 :subject => "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}"
186 :subject => "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}"
187 end
187 end
188
188
189 # Builds a tmail object used to email the recipients of a project of the specified wiki content was added.
189 # Builds a Mail::Message object used to email the recipients of a project of the specified wiki content was added.
190 #
190 #
191 # Example:
191 # Example:
192 # wiki_content_added(wiki_content) => tmail object
192 # wiki_content_added(wiki_content) => Mail::Message object
193 # Mailer.deliver_wiki_content_added(wiki_content) => sends an email to the project's recipients
193 # Mailer.wiki_content_added(wiki_content).deliver => sends an email to the project's recipients
194 def wiki_content_added(wiki_content)
194 def wiki_content_added(wiki_content)
195 redmine_headers 'Project' => wiki_content.project.identifier,
195 redmine_headers 'Project' => wiki_content.project.identifier,
196 'Wiki-Page-Id' => wiki_content.page.id
196 'Wiki-Page-Id' => wiki_content.page.id
@@ -207,11 +207,11 class Mailer < ActionMailer::Base
207 :subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :id => wiki_content.page.pretty_title)}"
207 :subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :id => wiki_content.page.pretty_title)}"
208 end
208 end
209
209
210 # Builds a tmail object used to email the recipients of a project of the specified wiki content was updated.
210 # Builds a Mail::Message object used to email the recipients of a project of the specified wiki content was updated.
211 #
211 #
212 # Example:
212 # Example:
213 # wiki_content_updated(wiki_content) => tmail object
213 # wiki_content_updated(wiki_content) => Mail::Message object
214 # Mailer.deliver_wiki_content_updated(wiki_content) => sends an email to the project's recipients
214 # Mailer.wiki_content_updated(wiki_content).deliver => sends an email to the project's recipients
215 def wiki_content_updated(wiki_content)
215 def wiki_content_updated(wiki_content)
216 redmine_headers 'Project' => wiki_content.project.identifier,
216 redmine_headers 'Project' => wiki_content.project.identifier,
217 'Wiki-Page-Id' => wiki_content.page.id
217 'Wiki-Page-Id' => wiki_content.page.id
@@ -231,11 +231,11 class Mailer < ActionMailer::Base
231 :subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :id => wiki_content.page.pretty_title)}"
231 :subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :id => wiki_content.page.pretty_title)}"
232 end
232 end
233
233
234 # Builds a tmail object used to email the specified user their account information.
234 # Builds a Mail::Message object used to email the specified user their account information.
235 #
235 #
236 # Example:
236 # Example:
237 # account_information(user, password) => tmail object
237 # account_information(user, password) => Mail::Message object
238 # Mailer.deliver_account_information(user, password) => sends account information to the user
238 # Mailer.account_information(user, password).deliver => sends account information to the user
239 def account_information(user, password)
239 def account_information(user, password)
240 set_language_if_valid user.language
240 set_language_if_valid user.language
241 @user = user
241 @user = user
@@ -245,11 +245,11 class Mailer < ActionMailer::Base
245 :subject => l(:mail_subject_register, Setting.app_title)
245 :subject => l(:mail_subject_register, Setting.app_title)
246 end
246 end
247
247
248 # Builds a tmail object used to email all active administrators of an account activation request.
248 # Builds a Mail::Message object used to email all active administrators of an account activation request.
249 #
249 #
250 # Example:
250 # Example:
251 # account_activation_request(user) => tmail object
251 # account_activation_request(user) => Mail::Message object
252 # Mailer.deliver_account_activation_request(user)=> sends an email to all active administrators
252 # Mailer.account_activation_request(user).deliver => sends an email to all active administrators
253 def account_activation_request(user)
253 def account_activation_request(user)
254 # Send the email to all active administrators
254 # Send the email to all active administrators
255 recipients = User.active.find(:all, :conditions => {:admin => true}).collect { |u| u.mail }.compact
255 recipients = User.active.find(:all, :conditions => {:admin => true}).collect { |u| u.mail }.compact
@@ -261,11 +261,11 class Mailer < ActionMailer::Base
261 :subject => l(:mail_subject_account_activation_request, Setting.app_title)
261 :subject => l(:mail_subject_account_activation_request, Setting.app_title)
262 end
262 end
263
263
264 # Builds a tmail object used to email the specified user that their account was activated by an administrator.
264 # Builds a Mail::Message object used to email the specified user that their account was activated by an administrator.
265 #
265 #
266 # Example:
266 # Example:
267 # account_activated(user) => tmail object
267 # account_activated(user) => Mail::Message object
268 # Mailer.deliver_account_activated(user) => sends an email to the registered user
268 # Mailer.account_activated(user).deliver => sends an email to the registered user
269 def account_activated(user)
269 def account_activated(user)
270 set_language_if_valid user.language
270 set_language_if_valid user.language
271 @user = user
271 @user = user
General Comments 0
You need to be logged in to leave comments. Login now