Class: HCA::EzrSubmissionJob
- Inherits:
-
Object
- Object
- HCA::EzrSubmissionJob
show all
- Extended by:
- SentryLogging
- Includes:
- Sidekiq::Job
- Defined in:
- app/sidekiq/hca/ezr_submission_job.rb
Constant Summary
collapse
- VALIDATION_ERROR =
HCA::SOAPParser::ValidationError
- STATSD_KEY_PREFIX =
'api.1010ezr'
- DD_ZSF_TAGS =
[
'service:healthcare-application',
'function: 10-10EZR async form submission'
].freeze
Class Method Summary
collapse
Instance Method Summary
collapse
log_exception_to_sentry, log_message_to_sentry, non_nil_hash?, normalize_level, rails_logger, set_sentry_metadata
Class Method Details
43
44
45
|
# File 'app/sidekiq/hca/ezr_submission_job.rb', line 43
def self.decrypt_form(encrypted_form)
JSON.parse(HealthCareApplication::LOCKBOX.decrypt(encrypted_form))
end
|
.send_failure_email(parsed_form) ⇒ Object
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'app/sidekiq/hca/ezr_submission_job.rb', line 47
def self.send_failure_email(parsed_form)
email = parsed_form['email']
return if email.blank?
first_name = parsed_form.dig('veteranFullName', 'first')
template_id = Settings.vanotify.services.health_apps_1010.template_id.form1010_ezr_failure_email
api_key = Settings.vanotify.services.health_apps_1010.api_key
salutation = first_name ? "Dear #{first_name}," : ''
VANotify::EmailJob.perform_async(
email,
template_id,
{ 'salutation' => salutation },
api_key
)
StatsD.increment("#{STATSD_KEY_PREFIX}.submission_failure_email_sent")
StatsD.increment('silent_failure_avoided_no_confirmation', tags: DD_ZSF_TAGS)
end
|