diff options
Diffstat (limited to 'app/mailers/emails/profile.rb')
-rw-r--r-- | app/mailers/emails/profile.rb | 56 |
1 files changed, 17 insertions, 39 deletions
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb index 54a4c4be6a8..a382ca15e46 100644 --- a/app/mailers/emails/profile.rb +++ b/app/mailers/emails/profile.rb @@ -65,9 +65,7 @@ module Emails @target_url = profile_personal_access_tokens_url @token_name = token_name - Gitlab::I18n.with_locale(@user.preferred_language) do - mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("A new personal access token has been created"))) - end + mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("A new personal access token has been created"))) end def access_token_about_to_expire_email(user, token_names) @@ -78,9 +76,7 @@ module Emails @target_url = profile_personal_access_tokens_url @days_to_expire = PersonalAccessToken::DAYS_TO_EXPIRE - Gitlab::I18n.with_locale(@user.preferred_language) do - mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Your personal access tokens will expire in %{days_to_expire} days or less") % { days_to_expire: @days_to_expire })) - end + mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Your personal access tokens will expire in %{days_to_expire} days or less") % { days_to_expire: @days_to_expire })) end def access_token_expired_email(user, token_names = []) @@ -90,9 +86,7 @@ module Emails @token_names = token_names @target_url = profile_personal_access_tokens_url - Gitlab::I18n.with_locale(@user.preferred_language) do - mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Your personal access tokens have expired"))) - end + email_with_layout(to: @user.notification_email_or_default, subject: subject(_("Your personal access tokens have expired"))) end def access_token_revoked_email(user, token_name, source = nil) @@ -103,9 +97,7 @@ module Emails @target_url = profile_personal_access_tokens_url @source = source - Gitlab::I18n.with_locale(@user.preferred_language) do - mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("A personal access token has been revoked"))) - end + mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("A personal access token has been revoked"))) end def ssh_key_expired_email(user, fingerprints) @@ -115,9 +107,7 @@ module Emails @fingerprints = fingerprints @target_url = profile_keys_url - Gitlab::I18n.with_locale(@user.preferred_language) do - mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Your SSH key has expired"))) - end + mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Your SSH key has expired"))) end def ssh_key_expiring_soon_email(user, fingerprints) @@ -127,9 +117,7 @@ module Emails @fingerprints = fingerprints @target_url = profile_keys_url - Gitlab::I18n.with_locale(@user.preferred_language) do - mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Your SSH key is expiring soon."))) - end + mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Your SSH key is expiring soon."))) end def unknown_sign_in_email(user, ip, time) @@ -138,11 +126,9 @@ module Emails @time = time @target_url = edit_profile_password_url - Gitlab::I18n.with_locale(@user.preferred_language) do - email_with_layout( - to: @user.notification_email_or_default, - subject: subject(_("%{host} sign-in from new location") % { host: Gitlab.config.gitlab.host })) - end + email_with_layout( + to: @user.notification_email_or_default, + subject: subject(_("%{host} sign-in from new location") % { host: Gitlab.config.gitlab.host })) end def two_factor_otp_attempt_failed_email(user, ip, time = Time.current) @@ -150,11 +136,9 @@ module Emails @ip = ip @time = time - Gitlab::I18n.with_locale(@user.preferred_language) do - email_with_layout( - to: @user.notification_email_or_default, - subject: subject(_("Attempted sign in to %{host} using an incorrect verification code") % { host: Gitlab.config.gitlab.host })) - end + email_with_layout( + to: @user.notification_email_or_default, + subject: subject(_("Attempted sign in to %{host} using an incorrect verification code") % { host: Gitlab.config.gitlab.host })) end def disabled_two_factor_email(user) @@ -162,9 +146,7 @@ module Emails @user = user - Gitlab::I18n.with_locale(@user.preferred_language) do - mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Two-factor authentication disabled"))) - end + mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Two-factor authentication disabled"))) end def new_email_address_added_email(user, email) @@ -173,9 +155,7 @@ module Emails @user = user @email = email - Gitlab::I18n.with_locale(@user.preferred_language) do - mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("New email address added"))) - end + mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("New email address added"))) end def new_achievement_email(user, achievement) @@ -184,11 +164,9 @@ module Emails @user = user @achievement = achievement - Gitlab::I18n.with_locale(@user.preferred_language) do - email_with_layout( - to: @user.notification_email_or_default, - subject: subject(s_("Achievements|%{namespace_full_path} awarded you the %{achievement_name} achievement") % { namespace_full_path: @achievement.namespace.full_path, achievement_name: @achievement.name })) - end + email_with_layout( + to: @user.notification_email_or_default, + subject: subject(s_("Achievements|%{namespace_full_path} awarded you the %{achievement_name} achievement") % { namespace_full_path: @achievement.namespace.full_path, achievement_name: @achievement.name })) end end end |