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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-29 18:09:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-29 18:09:40 +0300
commit10052df7536415c192788799b294c9a5ecf07ce7 (patch)
tree0404e80139c6784aabf4985ee8f4e33d82278c61 /app/mailers
parenta4df3f0dbbe9a18ee6cadaef0d3313669eb1c7d6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/in_product_marketing.rb34
-rw-r--r--app/mailers/notify.rb2
2 files changed, 36 insertions, 0 deletions
diff --git a/app/mailers/emails/in_product_marketing.rb b/app/mailers/emails/in_product_marketing.rb
new file mode 100644
index 00000000000..0be9ec5f915
--- /dev/null
+++ b/app/mailers/emails/in_product_marketing.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+module Emails
+ module InProductMarketing
+ include InProductMarketingHelper
+
+ FROM_ADDRESS = 'GitLab <team@gitlab.com>'.freeze
+ CUSTOM_HEADERS = {
+ 'X-Mailgun-Track' => 'yes',
+ 'X-Mailgun-Track-Clicks' => 'yes',
+ 'X-Mailgun-Track-Opens' => 'yes',
+ 'X-Mailgun-Tag' => 'marketing'
+ }.freeze
+
+ def in_product_marketing_email(recipient_id, group_id, track, series)
+ @track = track
+ @series = series
+ @group = Group.find(group_id)
+
+ email = User.find(recipient_id).notification_email_for(@group)
+ subject = subject_line(track, series)
+ mail_to(to: email, subject: subject)
+ end
+
+ private
+
+ def mail_to(to:, subject:)
+ mail(to: to, subject: subject, from: FROM_ADDRESS, reply_to: FROM_ADDRESS, **CUSTOM_HEADERS) do |format|
+ format.html { render layout: nil }
+ format.text { render layout: nil }
+ end
+ end
+ end
+end
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index ebf6dd68ec7..8f947ea7113 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -21,6 +21,7 @@ class Notify < ApplicationMailer
include Emails::Groups
include Emails::Reviews
include Emails::ServiceDesk
+ include Emails::InProductMarketing
helper TimeboxesHelper
helper MergeRequestsHelper
@@ -32,6 +33,7 @@ class Notify < ApplicationMailer
helper AvatarsHelper
helper GitlabRoutingHelper
helper IssuablesHelper
+ helper InProductMarketingHelper
def test_email(recipient_email, subject, body)
mail(to: recipient_email,