Add email type as utm_campaign column (#13297)
This commit is contained in:
parent
f76a8e1e99
commit
7d9ce63e05
2 changed files with 14 additions and 2 deletions
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue