Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the callback_metadata key when we send an email to a user_account #19638

Merged
merged 5 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,23 @@ def async_job_with_user_account(user_account, at, template_id)
first_name_from_user_account = get_first_name_from_user_account
return unless first_name_from_user_account

VANotify::UserAccountJob.perform_at(
at,
user_account.id,
template_id,
get_personalization(first_name_from_user_account)
)
if Flipper.enabled?(:simple_forms_notification_callbacks)
VANotify::UserAccountJob.perform_at(
at,
user_account.id,
template_id,
get_personalization(first_name_from_user_account),
Settings.vanotify.services.va_gov.api_key,
{ callback_metadata: { notification_type:, form_number:, statsd_tags: } }
)
else
VANotify::UserAccountJob.perform_at(
at,
user_account.id,
template_id,
get_personalization(first_name_from_user_account)
)
end
end

def send_email_now(template_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
subject.send(at: time)

expect(VANotify::UserAccountJob).to have_received(:perform_at).with(time, user_account.id, anything,
anything)
anything, anything, anything)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these variables be more specific?

end
end

Expand Down
Loading