Revert "Merge branch 'fix-email-i18n' into 114-comment_notifications"
This reverts commit 9bf06e5e1a595f320dc4527ebd44f14be05fcd64, reversing changes made to f2bc0e67a91e6283f4881e754e5da95c59cf341b.
This commit is contained in:
parent
2e2e7e43d3
commit
255c39ef5a
|
@ -13,41 +13,24 @@ class UserMailer < ActionMailer::Base
|
||||||
def new_comment_notification(comment, user)
|
def new_comment_notification(comment, user)
|
||||||
@user = user
|
@user = user
|
||||||
@comment = comment
|
@comment = comment
|
||||||
set_locale
|
|
||||||
mail(:to => user.email, :subject => I18n.t("notifications.subjects.new_#{comment.commentable.class == Grit::Commit ? 'commit_' : ''}comment_notification")) do |format|
|
mail(:to => user.email, :subject => I18n.t("notifications.subjects.new_#{comment.commentable.class == Grit::Commit ? 'commit_' : ''}comment_notification")) do |format|
|
||||||
format.html
|
format.html
|
||||||
end
|
end
|
||||||
ensure reset_locale
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_issue_notification(issue, user)
|
def new_issue_notification(issue, user)
|
||||||
@user = user
|
@user = user
|
||||||
@issue = issue
|
@issue = issue
|
||||||
set_locale
|
|
||||||
mail(:to => user.email, :subject => I18n.t("notifications.subjects.new_issue_notification")) do |format|
|
mail(:to => user.email, :subject => I18n.t("notifications.subjects.new_issue_notification")) do |format|
|
||||||
format.html
|
format.html
|
||||||
end
|
end
|
||||||
ensure reset_locale
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def issue_assign_notification(issue, user)
|
def issue_assign_notification(issue, user)
|
||||||
@user = user
|
@user = user
|
||||||
@issue = issue
|
@issue = issue
|
||||||
set_locale
|
|
||||||
mail(:to => user.email, :subject => I18n.t("notifications.subjects.issue_assign_notification")) do |format|
|
mail(:to => user.email, :subject => I18n.t("notifications.subjects.issue_assign_notification")) do |format|
|
||||||
format.html
|
format.html
|
||||||
end
|
end
|
||||||
ensure reset_locale
|
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def set_locale
|
|
||||||
@initial_locale, I18n.locale = I18n.locale, @user.language
|
|
||||||
end
|
|
||||||
|
|
||||||
def reset_locale
|
|
||||||
I18n.locale = @initial_locale
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue