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')
-rw-r--r--app/mailers/emails/admin_notification.rb4
-rw-r--r--app/mailers/emails/groups.rb2
-rw-r--r--app/mailers/emails/identity_verification.rb2
-rw-r--r--app/mailers/emails/in_product_marketing.rb2
-rw-r--r--app/mailers/emails/members.rb2
-rw-r--r--app/mailers/emails/pages_domains.rb10
-rw-r--r--app/mailers/emails/profile.rb20
-rw-r--r--app/mailers/emails/projects.rb25
-rw-r--r--app/mailers/emails/releases.rb2
-rw-r--r--app/mailers/emails/remote_mirrors.rb2
10 files changed, 37 insertions, 34 deletions
diff --git a/app/mailers/emails/admin_notification.rb b/app/mailers/emails/admin_notification.rb
index 3766b4447d1..5c5497d8eb5 100644
--- a/app/mailers/emails/admin_notification.rb
+++ b/app/mailers/emails/admin_notification.rb
@@ -7,13 +7,13 @@ module Emails
email = user.notification_email_or_default
@unsubscribe_url = unsubscribe_url(email: Base64.urlsafe_encode64(email))
@body = body
- mail to: email, subject: subject
+ mail_with_locale to: email, subject: subject
end
def send_unsubscribed_notification(user_id)
user = User.find(user_id)
email = user.notification_email_or_default
- mail to: email, subject: "Unsubscribed from GitLab administrator notifications"
+ mail_with_locale to: email, subject: "Unsubscribed from GitLab administrator notifications"
end
end
end
diff --git a/app/mailers/emails/groups.rb b/app/mailers/emails/groups.rb
index 07812a01202..3c9bf41c208 100644
--- a/app/mailers/emails/groups.rb
+++ b/app/mailers/emails/groups.rb
@@ -13,7 +13,7 @@ module Emails
def group_email(current_user, group, subj, errors: nil)
@group = group
@errors = errors
- mail(to: current_user.notification_email_for(@group), subject: subject(subj))
+ mail_with_locale(to: current_user.notification_email_for(@group), subject: subject(subj))
end
end
end
diff --git a/app/mailers/emails/identity_verification.rb b/app/mailers/emails/identity_verification.rb
index 2fc8cae06fe..e3089fdef9b 100644
--- a/app/mailers/emails/identity_verification.rb
+++ b/app/mailers/emails/identity_verification.rb
@@ -13,3 +13,5 @@ module Emails
end
end
end
+
+Emails::IdentityVerification.prepend_mod
diff --git a/app/mailers/emails/in_product_marketing.rb b/app/mailers/emails/in_product_marketing.rb
index 1b46d4841b0..972c1da065a 100644
--- a/app/mailers/emails/in_product_marketing.rb
+++ b/app/mailers/emails/in_product_marketing.rb
@@ -31,7 +31,7 @@ module Emails
def mail_to(to:, subject:)
custom_headers = Gitlab.com? ? CUSTOM_HEADERS : {}
- mail(to: to, subject: subject, **custom_headers) do |format|
+ mail_with_locale(to: to, subject: subject, **custom_headers) do |format|
format.html do
@message.format = :html
diff --git a/app/mailers/emails/members.rb b/app/mailers/emails/members.rb
index c885e41671c..33c955f94ee 100644
--- a/app/mailers/emails/members.rb
+++ b/app/mailers/emails/members.rb
@@ -61,7 +61,7 @@ module Emails
Gitlab::Tracking.event(self.class.name, 'invite_email_sent', label: 'invite_email', property: member_id.to_s)
- mail(to: member.invite_email, subject: invite_email_subject, **invite_email_headers) do |format|
+ mail_with_locale(to: member.invite_email, subject: invite_email_subject, **invite_email_headers) do |format|
format.html { render layout: 'unknown_user_mailer' }
format.text { render layout: 'unknown_user_mailer' }
end
diff --git a/app/mailers/emails/pages_domains.rb b/app/mailers/emails/pages_domains.rb
index 6c3dcf8746b..a6e9da18689 100644
--- a/app/mailers/emails/pages_domains.rb
+++ b/app/mailers/emails/pages_domains.rb
@@ -6,7 +6,7 @@ module Emails
@domain = domain
@project = domain.project
- mail(
+ mail_with_locale(
to: recipient.notification_email_for(@project.group),
subject: subject("GitLab Pages domain '#{domain.domain}' has been enabled")
)
@@ -16,7 +16,7 @@ module Emails
@domain = domain
@project = domain.project
- mail(
+ mail_with_locale(
to: recipient.notification_email_for(@project.group),
subject: subject("GitLab Pages domain '#{domain.domain}' has been disabled")
)
@@ -26,7 +26,7 @@ module Emails
@domain = domain
@project = domain.project
- mail(
+ mail_with_locale(
to: recipient.notification_email_for(@project.group),
subject: subject("Verification succeeded for GitLab Pages domain '#{domain.domain}'")
)
@@ -36,7 +36,7 @@ module Emails
@domain = domain
@project = domain.project
- mail(
+ mail_with_locale(
to: recipient.notification_email_for(@project.group),
subject: subject("ACTION REQUIRED: Verification failed for GitLab Pages domain '#{domain.domain}'")
)
@@ -47,7 +47,7 @@ module Emails
@project = domain.project
subject_text = _("ACTION REQUIRED: Something went wrong while obtaining the Let's Encrypt certificate for GitLab Pages domain '%{domain}'") % { domain: domain.domain }
- mail(
+ mail_with_locale(
to: recipient.notification_email_for(@project.group),
subject: subject(subject_text)
)
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb
index 81f082b9680..8fe471a48f2 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_or_default, subject: subject("Account was created for you"))
+ mail_with_locale(to: @user.notification_email_or_default, subject: subject("Account was created for you"))
end
def instance_access_request_email(user, recipient)
@@ -42,7 +42,7 @@ module Emails
@current_user = @user = @key.user
@target_url = user_url(@user)
- mail(to: @user.notification_email_or_default, subject: subject("SSH key was added to your account"))
+ mail_with_locale(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_or_default, subject: subject("GPG key was added to your account"))
+ mail_with_locale(to: @user.notification_email_or_default, subject: subject("GPG key was added to your account"))
end
# rubocop: enable CodeReuse/ActiveRecord
@@ -66,7 +66,7 @@ module Emails
@token_name = token_name
Gitlab::I18n.with_locale(@user.preferred_language) do
- mail(to: @user.notification_email_or_default, subject: subject(_("A new personal access token has been created")))
+ mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("A new personal access token has been created")))
end
end
@@ -79,7 +79,7 @@ module Emails
@days_to_expire = PersonalAccessToken::DAYS_TO_EXPIRE
Gitlab::I18n.with_locale(@user.preferred_language) do
- 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 }))
+ 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
end
@@ -90,7 +90,7 @@ module Emails
@target_url = profile_personal_access_tokens_url
Gitlab::I18n.with_locale(@user.preferred_language) do
- mail(to: @user.notification_email_or_default, subject: subject(_("Your personal access token has expired")))
+ mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Your personal access token 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_or_default, subject: subject(_("Your SSH key has expired")))
+ mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Your SSH key has expired")))
end
end
@@ -114,7 +114,7 @@ module Emails
@target_url = profile_keys_url
Gitlab::I18n.with_locale(@user.preferred_language) do
- mail(to: @user.notification_email_or_default, subject: subject(_("Your SSH key is expiring soon.")))
+ mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Your SSH key is expiring soon.")))
end
end
@@ -137,7 +137,7 @@ module Emails
@user = user
Gitlab::I18n.with_locale(@user.preferred_language) do
- mail(to: @user.notification_email_or_default, subject: subject(_("Two-factor authentication disabled")))
+ mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("Two-factor authentication disabled")))
end
end
@@ -148,7 +148,7 @@ module Emails
@email = email
Gitlab::I18n.with_locale(@user.preferred_language) do
- mail(to: @user.notification_email_or_default, subject: subject(_("New email address added")))
+ mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("New email address added")))
end
end
end
diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb
index 5b8471abb0f..4bb624c27e9 100644
--- a/app/mailers/emails/projects.rb
+++ b/app/mailers/emails/projects.rb
@@ -7,28 +7,29 @@ module Emails
@project = Project.find project_id
@target_url = project_url(@project)
@old_path_with_namespace = old_path_with_namespace
- mail(to: @user.notification_email_for(@project.group),
- subject: subject("Project was moved"))
+ mail_with_locale(to: @user.notification_email_for(@project.group),
+ subject: subject("Project was moved"))
end
def project_was_exported_email(current_user, project)
@project = project
- mail(to: current_user.notification_email_for(project.group),
- subject: subject("Project was exported"))
+ mail_with_locale(to: current_user.notification_email_for(project.group),
+ subject: subject("Project was exported"))
end
def project_was_not_exported_email(current_user, project, errors)
@project = project
@errors = errors
- mail(to: current_user.notification_email_for(@project.group),
- subject: subject("Project export error"))
+ mail_with_locale(to: current_user.notification_email_for(@project.group),
+ subject: subject("Project export error"))
end
def repository_cleanup_success_email(project, user)
@project = project
@user = user
- mail(to: user.notification_email_for(project.group), subject: subject("Project cleanup has completed"))
+ mail_with_locale(to: user.notification_email_for(project.group),
+ subject: subject("Project cleanup has completed"))
end
def repository_cleanup_failure_email(project, user, error)
@@ -36,7 +37,7 @@ module Emails
@user = user
@error = error
- mail(to: user.notification_email_for(project.group), subject: subject("Project cleanup failure"))
+ mail_with_locale(to: user.notification_email_for(project.group), subject: subject("Project cleanup failure"))
end
def repository_push_email(project_id, opts = {})
@@ -51,9 +52,9 @@ module Emails
add_project_headers
headers['X-GitLab-Author'] = @message.author_username
- mail(from: sender(@message.author_id, send_from_user_email: @message.send_from_committer_email?),
- reply_to: @message.reply_to,
- subject: @message.subject)
+ mail_with_locale(from: sender(@message.author_id, send_from_user_email: @message.send_from_committer_email?),
+ reply_to: @message.reply_to,
+ subject: @message.subject)
end
def prometheus_alert_fired_email(project, user, alert)
@@ -65,7 +66,7 @@ module Emails
add_alert_headers
subject_text = "Alert: #{@alert.email_title}"
- mail(to: user.notification_email_for(@project.group), subject: subject(subject_text))
+ mail_with_locale(to: user.notification_email_for(@project.group), subject: subject(subject_text))
end
def inactive_project_deletion_warning_email(project, user, deletion_date)
diff --git a/app/mailers/emails/releases.rb b/app/mailers/emails/releases.rb
index 4875abafe8d..8fe93f59662 100644
--- a/app/mailers/emails/releases.rb
+++ b/app/mailers/emails/releases.rb
@@ -11,7 +11,7 @@ module Emails
)
@recipient = User.find(user_id)
- mail(
+ mail_with_locale(
to: @recipient.notification_email_for(@project.group),
subject: subject(release_email_subject)
)
diff --git a/app/mailers/emails/remote_mirrors.rb b/app/mailers/emails/remote_mirrors.rb
index 9cde53918b9..791ab7103b4 100644
--- a/app/mailers/emails/remote_mirrors.rb
+++ b/app/mailers/emails/remote_mirrors.rb
@@ -7,7 +7,7 @@ module Emails
@project = @remote_mirror.project
user = User.find(recipient_id)
- mail(to: user.notification_email_for(@project.group), subject: subject('Remote mirror update failed'))
+ mail_with_locale(to: user.notification_email_for(@project.group), subject: subject('Remote mirror update failed'))
end
end
end