# create a new token for password recovery\r
token = Token.new(:user => user, :action => "recovery")\r
if token.save\r
- # send token to user via email\r
- Mailer.set_language_if_valid(user.language)\r
Mailer.deliver_lost_password(token)\r
flash[:notice] = l(:notice_account_lost_email_sent)\r
redirect_to :action => 'login'\r
@user.custom_values = @custom_values\r
token = Token.new(:user => @user, :action => "register")\r
if @user.save and token.save\r
- Mailer.set_language_if_valid(@user.language)\r
Mailer.deliver_register(token)\r
flash[:notice] = l(:notice_account_register_done)\r
redirect_to :controller => 'welcome' and return\r
class Mailer < ActionMailer::Base\r
helper IssuesHelper
- def issue_add(issue)
+ def issue_add(issue)\r
+ set_language_if_valid(Setting.default_language)
# Sends to all project members
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
@from = Setting.mail_from
end\r
\r
def issue_edit(journal)\r
+ set_language_if_valid(Setting.default_language)\r
# Sends to all project members\r
issue = journal.journalized\r
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact\r
end\r
\r
def document_add(document)\r
+ set_language_if_valid(Setting.default_language)\r
@recipients = document.project.users.collect { |u| u.mail if u.mail_notification }.compact\r
@from = Setting.mail_from\r
@subject = "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"\r
end\r
\r
def attachments_add(attachments)\r
+ set_language_if_valid(Setting.default_language)\r
container = attachments.first.container\r
url = "http://#{Setting.host_name}/"\r
added_to = ""\r
end\r
\r
def lost_password(token)\r
+ set_language_if_valid(token.user.language)\r
@recipients = token.user.mail\r
@from = Setting.mail_from\r
@subject = l(:mail_subject_lost_password)\r
end
\r
def register(token)\r
+ set_language_if_valid(token.user.language)\r
@recipients = token.user.mail\r
@from = Setting.mail_from\r
@subject = l(:mail_subject_register)\r