Add email type as utm_campaign column (#13297)

This commit is contained in:
Andy Zhao 2021-04-07 12:54:51 -04:00 committed by GitHub
parent f76a8e1e99
commit 7d9ce63e05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View file

@ -1,6 +1,10 @@
class NotifyMailer < ApplicationMailer
has_history extra: -> { { feedback_message_id: params[:feedback_message_id] } },
only: :feedback_message_resolution_email
has_history extra: lambda {
{
feedback_message_id: params[:feedback_message_id],
utm_campaign: params[:email_type]
}
}, only: :feedback_message_resolution_email
def new_reply_email
@comment = params[:comment]

View file

@ -281,6 +281,14 @@ RSpec.describe NotifyMailer, type: :mailer do
expect(user.email_messages.last.feedback_message_id).to eq(feedback_message.id)
end
it "tracks the email_type as the UTM campaign" do
assert_emails 1 do
email.deliver_now
end
expect(user.email_messages.last.utm_campaign).to eq("Reporter")
end
end
describe "#feedback_response_email" do