diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-16 18:12:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-16 18:12:47 +0300 |
commit | 49769473ab2fc0471853ada294c2f9a66f25f048 (patch) | |
tree | 90c5c0e34808f05a1e655b2855277cd635fb5c75 /app/mailers | |
parent | 4c16d4ff4f92987f609e9853da5900a51f0ad1be (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/emails/admin_notification.rb | 4 | ||||
-rw-r--r-- | app/mailers/emails/profile.rb | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/app/mailers/emails/admin_notification.rb b/app/mailers/emails/admin_notification.rb index f4540ef81a5..e11f06d8fc9 100644 --- a/app/mailers/emails/admin_notification.rb +++ b/app/mailers/emails/admin_notification.rb @@ -4,7 +4,7 @@ module Emails module AdminNotification def send_admin_notification(user_id, subject, body) user = User.find(user_id) - email = user.notification_email + email = user.notification_email_or_default @unsubscribe_url = unsubscribe_url(email: Base64.urlsafe_encode64(email)) @body = body mail to: email, subject: subject @@ -12,7 +12,7 @@ module Emails def send_unsubscribed_notification(user_id) user = User.find(user_id) - email = user.notification_email + email = user.notification_email_or_default mail to: email, subject: "Unsubscribed from GitLab administrator notifications" end end diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb index a8affb34f62..592c394bb48 100644 --- a/app/mailers/emails/profile.rb +++ b/app/mailers/emails/profile.rb @@ -6,7 +6,7 @@ module Emails @current_user = @user = User.find(user_id) @target_url = user_url(@user) @token = token - mail(to: @user.notification_email, subject: subject("Account was created for you")) + mail(to: @user.notification_email_or_default, subject: subject("Account was created for you")) end def instance_access_request_email(user, recipient) @@ -14,7 +14,7 @@ module Emails @recipient = recipient profile_email_with_layout( - to: recipient.notification_email, + to: recipient.notification_email_or_default, subject: subject(_("GitLab Account Request"))) end @@ -42,7 +42,7 @@ module Emails @current_user = @user = @key.user @target_url = user_url(@user) - mail(to: @user.notification_email, subject: subject("SSH key was added to your account")) + mail(to: @user.notification_email_or_default, subject: subject("SSH key was added to your account")) end # rubocop: enable CodeReuse/ActiveRecord @@ -54,7 +54,7 @@ module Emails @current_user = @user = @gpg_key.user @target_url = user_url(@user) - mail(to: @user.notification_email, subject: subject("GPG key was added to your account")) + mail(to: @user.notification_email_or_default, subject: subject("GPG key was added to your account")) end # rubocop: enable CodeReuse/ActiveRecord @@ -67,7 +67,7 @@ module Emails @days_to_expire = PersonalAccessToken::DAYS_TO_EXPIRE Gitlab::I18n.with_locale(@user.preferred_language) do - mail(to: @user.notification_email, subject: subject(_("Your personal access tokens will expire in %{days_to_expire} days or less") % { days_to_expire: @days_to_expire })) + mail(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 end @@ -78,7 +78,7 @@ module Emails @target_url = profile_personal_access_tokens_url Gitlab::I18n.with_locale(@user.preferred_language) do - mail(to: @user.notification_email, subject: subject(_("Your personal access token has expired"))) + mail(to: @user.notification_email_or_default, subject: subject(_("Your personal access token has expired"))) end end @@ -90,7 +90,7 @@ module Emails @target_url = profile_keys_url Gitlab::I18n.with_locale(@user.preferred_language) do - mail(to: @user.notification_email, subject: subject(_("Your SSH key has expired"))) + mail(to: @user.notification_email_or_default, subject: subject(_("Your SSH key has expired"))) end end @@ -102,7 +102,7 @@ module Emails @target_url = profile_keys_url Gitlab::I18n.with_locale(@user.preferred_language) do - mail(to: @user.notification_email, subject: subject(_("Your SSH key is expiring soon."))) + mail(to: @user.notification_email_or_default, subject: subject(_("Your SSH key is expiring soon."))) end end @@ -114,7 +114,7 @@ module Emails Gitlab::I18n.with_locale(@user.preferred_language) do profile_email_with_layout( - to: @user.notification_email, + to: @user.notification_email_or_default, subject: subject(_("%{host} sign-in from new location") % { host: Gitlab.config.gitlab.host })) end end @@ -125,7 +125,7 @@ module Emails @user = user Gitlab::I18n.with_locale(@user.preferred_language) do - mail(to: @user.notification_email, subject: subject(_("Two-factor authentication disabled"))) + mail(to: @user.notification_email_or_default, subject: subject(_("Two-factor authentication disabled"))) end end |