diff options
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/emails/identity_verification.rb | 16 | ||||
-rw-r--r-- | app/mailers/emails/releases.rb | 2 | ||||
-rw-r--r-- | app/mailers/previews/notify_preview.rb | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/app/mailers/emails/identity_verification.rb b/app/mailers/emails/identity_verification.rb index e3089fdef9b..f3fe609e7d1 100644 --- a/app/mailers/emails/identity_verification.rb +++ b/app/mailers/emails/identity_verification.rb @@ -2,14 +2,22 @@ module Emails module IdentityVerification - def verification_instructions_email(user_id, token:, expires_in:) + def verification_instructions_email(email, token:) @token = token - @expires_in_minutes = expires_in + @expires_in_minutes = Users::EmailVerification::ValidateTokenService::TOKEN_VALID_FOR_MINUTES @password_link = edit_profile_password_url @two_fa_link = help_page_url('user/profile/account/two_factor_authentication') - user = User.find(user_id) - email_with_layout(to: user.email, subject: s_('IdentityVerification|Verify your identity')) + headers = { + to: email, + subject: s_('IdentityVerification|Verify your identity'), + 'X-Mailgun-Suppressions-Bypass' => 'true' + } + + mail_with_locale(headers) do |format| + format.html { render layout: 'mailer' } + format.text + end end end end diff --git a/app/mailers/emails/releases.rb b/app/mailers/emails/releases.rb index 8fe93f59662..468a8624319 100644 --- a/app/mailers/emails/releases.rb +++ b/app/mailers/emails/releases.rb @@ -11,6 +11,8 @@ module Emails ) @recipient = User.find(user_id) + add_project_headers + mail_with_locale( to: @recipient.notification_email_for(@project.group), subject: subject(release_email_subject) diff --git a/app/mailers/previews/notify_preview.rb b/app/mailers/previews/notify_preview.rb index 206518e582b..7d7e01950c8 100644 --- a/app/mailers/previews/notify_preview.rb +++ b/app/mailers/previews/notify_preview.rb @@ -210,7 +210,7 @@ class NotifyPreview < ActionMailer::Preview end def verification_instructions_email - Notify.verification_instructions_email(user.id, token: '123456', expires_in: 60).message + Notify.verification_instructions_email(user.email, token: '123456').message end def project_was_exported_email |