From 842ccbe0ff93e63f825ff4a81de28c964e6425cb Mon Sep 17 00:00:00 2001 From: Derrick Ellerbie Date: Fri, 3 Jan 2025 10:11:15 -0800 Subject: [PATCH] EZR: Add VANotify callback metadata to email notify job --- app/sidekiq/hca/ezr_submission_job.rb | 11 ++++++++++- spec/sidekiq/hca/ezr_submission_job_spec.rb | 9 ++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/sidekiq/hca/ezr_submission_job.rb b/app/sidekiq/hca/ezr_submission_job.rb index 66b09ce8097..88e30ab3533 100644 --- a/app/sidekiq/hca/ezr_submission_job.rb +++ b/app/sidekiq/hca/ezr_submission_job.rb @@ -7,6 +7,8 @@ module HCA class EzrSubmissionJob include Sidekiq::Job extend SentryLogging + + FORM_ID = '10-10EZR' VALIDATION_ERROR = HCA::SOAPParser::ValidationError STATSD_KEY_PREFIX = 'api.1010ezr' DD_ZSF_TAGS = [ @@ -57,7 +59,14 @@ def self.send_failure_email(parsed_form) email, template_id, { 'salutation' => salutation }, - api_key + api_key, + { + callback_metadata: { + notification_type: 'error', + form_number: FORM_ID, + statsd_tags: DD_ZSF_TAGS + } + } ) StatsD.increment("#{STATSD_KEY_PREFIX}.submission_failure_email_sent") StatsD.increment('silent_failure_avoided_no_confirmation', tags: DD_ZSF_TAGS) diff --git a/spec/sidekiq/hca/ezr_submission_job_spec.rb b/spec/sidekiq/hca/ezr_submission_job_spec.rb index 12b884919e3..c7ea01c7e3d 100644 --- a/spec/sidekiq/hca/ezr_submission_job_spec.rb +++ b/spec/sidekiq/hca/ezr_submission_job_spec.rb @@ -47,7 +47,14 @@ { 'salutation' => "Dear #{form.dig('veteranFullName', 'first')}," }, - api_key + api_key, + { + callback_metadata: { + notification_type: 'error', + form_number: described_class::FORM_ID, + statsd_tags: described_class::DD_ZSF_TAGS + } + } ] end