summaryrefslogtreecommitdiff
path: root/app/mailers/emails
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-19 15:44:42 +0000
commit4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch)
tree5423a1c7516cffe36384133ade12572cf709398d /app/mailers/emails
parente570267f2f6b326480d284e0164a6464ba4081bc (diff)
downloadgitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/mailers/emails')
-rw-r--r--app/mailers/emails/in_product_marketing.rb25
-rw-r--r--app/mailers/emails/issues.rb2
-rw-r--r--app/mailers/emails/members.rb2
-rw-r--r--app/mailers/emails/merge_requests.rb2
-rw-r--r--app/mailers/emails/notes.rb2
-rw-r--r--app/mailers/emails/profile.rb2
-rw-r--r--app/mailers/emails/projects.rb2
7 files changed, 21 insertions, 16 deletions
diff --git a/app/mailers/emails/in_product_marketing.rb b/app/mailers/emails/in_product_marketing.rb
index d21c3d13b10..97243660512 100644
--- a/app/mailers/emails/in_product_marketing.rb
+++ b/app/mailers/emails/in_product_marketing.rb
@@ -2,8 +2,6 @@
module Emails
module InProductMarketing
- include InProductMarketingHelper
-
FROM_ADDRESS = 'GitLab <team@gitlab.com>'
CUSTOM_HEADERS = {
from: FROM_ADDRESS,
@@ -15,13 +13,11 @@ module Emails
}.freeze
def in_product_marketing_email(recipient_id, group_id, track, series)
- @track = track
- @series = series
- @group = Group.find(group_id)
+ group = Group.find(group_id)
+ email = User.find(recipient_id).notification_email_for(group)
+ @message = Gitlab::Email::Message::InProductMarketing.for(track).new(group: group, series: series)
- email = User.find(recipient_id).notification_email_for(@group)
- subject = subject_line(track, series)
- mail_to(to: email, subject: subject)
+ mail_to(to: email, subject: @message.subject_line)
end
private
@@ -29,8 +25,17 @@ module Emails
def mail_to(to:, subject:)
custom_headers = Gitlab.com? ? CUSTOM_HEADERS : {}
mail(to: to, subject: subject, **custom_headers) do |format|
- format.html { render layout: nil }
- format.text { render layout: nil }
+ format.html do
+ @message.format = :html
+
+ render layout: nil
+ end
+
+ format.text do
+ @message.format = :text
+
+ render layout: nil
+ end
end
end
end
diff --git a/app/mailers/emails/issues.rb b/app/mailers/emails/issues.rb
index c565df1a2ee..51c4779d8cf 100644
--- a/app/mailers/emails/issues.rb
+++ b/app/mailers/emails/issues.rb
@@ -139,4 +139,4 @@ module Emails
end
end
-Emails::Issues.prepend_if_ee('EE::Emails::Issues')
+Emails::Issues.prepend_mod_with('Emails::Issues')
diff --git a/app/mailers/emails/members.rb b/app/mailers/emails/members.rb
index f4d3676dc5c..674a9bfc4eb 100644
--- a/app/mailers/emails/members.rb
+++ b/app/mailers/emails/members.rb
@@ -167,4 +167,4 @@ module Emails
end
end
-Emails::Members.prepend_if_ee('EE::Emails::Members')
+Emails::Members.prepend_mod_with('Emails::Members')
diff --git a/app/mailers/emails/merge_requests.rb b/app/mailers/emails/merge_requests.rb
index e538b5e4718..2746b8b7188 100644
--- a/app/mailers/emails/merge_requests.rb
+++ b/app/mailers/emails/merge_requests.rb
@@ -167,4 +167,4 @@ module Emails
end
end
-Emails::MergeRequests.prepend_if_ee('EE::Emails::MergeRequests')
+Emails::MergeRequests.prepend_mod_with('Emails::MergeRequests')
diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb
index 4b56ff60f09..587c1479286 100644
--- a/app/mailers/emails/notes.rb
+++ b/app/mailers/emails/notes.rb
@@ -84,4 +84,4 @@ module Emails
end
end
-Emails::Notes.prepend_if_ee('EE::Emails::Notes')
+Emails::Notes.prepend_mod_with('Emails::Notes')
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb
index f967323f849..2efcba54c13 100644
--- a/app/mailers/emails/profile.rb
+++ b/app/mailers/emails/profile.rb
@@ -132,4 +132,4 @@ module Emails
end
end
-Emails::Profile.prepend_if_ee('EE::Emails::Profile')
+Emails::Profile.prepend_mod_with('Emails::Profile')
diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb
index a4b7b140169..2ae82b49609 100644
--- a/app/mailers/emails/projects.rb
+++ b/app/mailers/emails/projects.rb
@@ -66,4 +66,4 @@ module Emails
end
end
-Emails::Projects.prepend_if_ee('EE::Emails::Projects')
+Emails::Projects.prepend_mod_with('Emails::Projects')