diff options
Diffstat (limited to 'app/mailers/emails/in_product_marketing.rb')
-rw-r--r-- | app/mailers/emails/in_product_marketing.rb | 25 |
1 files changed, 15 insertions, 10 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 |