diff options
Diffstat (limited to 'app/mailers/emails')
-rw-r--r-- | app/mailers/emails/in_product_marketing.rb | 34 | ||||
-rw-r--r-- | app/mailers/emails/members.rb | 2 | ||||
-rw-r--r-- | app/mailers/emails/merge_requests.rb | 7 |
3 files changed, 43 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/emails/members.rb b/app/mailers/emails/members.rb index 69f5fe1430a..f4d3676dc5c 100644 --- a/app/mailers/emails/members.rb +++ b/app/mailers/emails/members.rb @@ -4,9 +4,11 @@ module Emails module Members extend ActiveSupport::Concern include MembersHelper + include Gitlab::Experiment::Dsl included do helper_method :member_source, :member + helper_method :experiment end def member_access_requested_email(member_source_type, member_id, recipient_id) diff --git a/app/mailers/emails/merge_requests.rb b/app/mailers/emails/merge_requests.rb index 4faa1a11276..494d9875ce4 100644 --- a/app/mailers/emails/merge_requests.rb +++ b/app/mailers/emails/merge_requests.rb @@ -82,6 +82,13 @@ module Emails mail_answer_thread(@merge_request, merge_request_thread_options(updated_by_user_id, recipient_id, reason)) end + def request_review_merge_request_email(recipient_id, merge_request_id, updated_by_user_id, reason = nil) + setup_merge_request_mail(merge_request_id, recipient_id) + + @updated_by = User.find(updated_by_user_id) + mail_answer_thread(@merge_request, merge_request_thread_options(updated_by_user_id, recipient_id, reason)) + end + def merge_request_status_email(recipient_id, merge_request_id, status, updated_by_user_id, reason = nil) setup_merge_request_mail(merge_request_id, recipient_id) |