Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/mailers/emails/profile.rb')
-rw-r--r--app/mailers/emails/profile.rb26
1 files changed, 25 insertions, 1 deletions
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb
index 25d68d47228..a9e1efbdd5d 100644
--- a/app/mailers/emails/profile.rb
+++ b/app/mailers/emails/profile.rb
@@ -2,6 +2,8 @@
module Emails
module Profile
+ include SafeFormatHelper
+
def new_user_email(user_id, token = nil)
@current_user = @user = User.find(user_id)
@target_url = user_url(@user)
@@ -58,6 +60,28 @@ module Emails
end
# rubocop: enable CodeReuse/ActiveRecord
+ def resource_access_tokens_about_to_expire_email(recipient, resource, token_names)
+ @user = recipient
+ @token_names = token_names
+ @days_to_expire = PersonalAccessToken::DAYS_TO_EXPIRE
+ @resource = resource
+ @target_url = if resource.is_a?(Group)
+ group_settings_access_tokens_url(resource)
+ else
+ project_settings_access_tokens_url(resource)
+ end
+
+ mail_with_locale(
+ to: recipient.notification_email_or_default,
+ subject: subject(
+ safe_format(
+ _("Your resource access tokens will expire in %{days_to_expire} or less"),
+ days_to_expire: pluralize(@days_to_expire, _('day'))
+ )
+ )
+ )
+ end
+
def access_token_created_email(user, token_name)
return unless user&.active?
@@ -155,7 +179,7 @@ module Emails
@user = user
@email = email
- mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("New email address added")))
+ email_with_layout(to: @user.notification_email_or_default, subject: subject(_("New email address added")))
end
def new_achievement_email(user, achievement)