-
Notifications
You must be signed in to change notification settings - Fork 166
LG-12091 Send please call email #9977
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
Changes from all commits
f0c395e
005ba2a
952de5b
6f6b7b3
aed1583
2027a98
cfbccec
fa98dc9
1ca20a3
9a82efc
d32c38b
76a08d4
ad3256e
5715bba
89dc098
9d8aead
d85df46
adb7c10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -391,6 +391,31 @@ def handle_successful_status_update(enrollment, response) | |||||||||||||||
| end | ||||||||||||||||
| end | ||||||||||||||||
|
|
||||||||||||||||
| def handle_passed_with_fraud_review_pending(enrollment, response) | ||||||||||||||||
| proofed_at = parse_usps_timestamp(response['transactionEndDateTime']) | ||||||||||||||||
| enrollment_outcomes[:enrollments_passed] += 1 | ||||||||||||||||
| analytics(user: enrollment.user).idv_in_person_usps_proofing_results_job_enrollment_updated( | ||||||||||||||||
| **enrollment_analytics_attributes(enrollment, complete: true), | ||||||||||||||||
| **response_analytics_attributes(response), | ||||||||||||||||
| passed: true, | ||||||||||||||||
| reason: 'Passed with fraud pending', | ||||||||||||||||
| job_name: self.class.name, | ||||||||||||||||
| ) | ||||||||||||||||
| enrollment.update( | ||||||||||||||||
| status: :passed, | ||||||||||||||||
| proofed_at: proofed_at, | ||||||||||||||||
| status_check_completed_at: Time.zone.now, | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| # send email | ||||||||||||||||
| send_please_call_email(enrollment.user, enrollment) | ||||||||||||||||
| analytics(user: enrollment.user). | ||||||||||||||||
| idv_in_person_usps_proofing_results_job_please_call_email_initiated( | ||||||||||||||||
| **email_analytics_attributes(enrollment), | ||||||||||||||||
| job_name: self.class.name, | ||||||||||||||||
| ) | ||||||||||||||||
| end | ||||||||||||||||
|
|
||||||||||||||||
| def handle_unsupported_secondary_id(enrollment, response) | ||||||||||||||||
| proofed_at = parse_usps_timestamp(response['transactionEndDateTime']) | ||||||||||||||||
| enrollment_outcomes[:enrollments_failed] += 1 | ||||||||||||||||
|
|
@@ -435,7 +460,9 @@ def process_enrollment_response(enrollment, response) | |||||||||||||||
|
|
||||||||||||||||
| case response['status'] | ||||||||||||||||
| when IPP_STATUS_PASSED | ||||||||||||||||
| if passed_with_unsupported_secondary_id_type?(response) | ||||||||||||||||
| if fraud_result_pending?(enrollment) | ||||||||||||||||
svalexander marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
| handle_passed_with_fraud_review_pending(enrollment, response) | ||||||||||||||||
| elsif passed_with_unsupported_secondary_id_type?(response) | ||||||||||||||||
| handle_unsupported_secondary_id(enrollment, response) | ||||||||||||||||
| elsif SUPPORTED_ID_TYPES.include?(response['primaryIdType']) | ||||||||||||||||
| handle_successful_status_update(enrollment, response) | ||||||||||||||||
|
|
@@ -489,6 +516,16 @@ def send_failed_fraud_email(user, enrollment) | |||||||||||||||
| end | ||||||||||||||||
| end | ||||||||||||||||
|
|
||||||||||||||||
| def send_please_call_email(user, enrollment) | ||||||||||||||||
| user.confirmed_email_addresses.each do |email_address| | ||||||||||||||||
| # rubocop:disable IdentityIdp/MailLaterLinter | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Is there an easy-ish formatting thing we can do so we're not disabling the linter? I feel like that's a bit of a flag.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a custom rule that enforces the use of https://github.com/18F/identity-idp/blob/main/lib/linters/mail_later_linter.rb
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok interesting. Thanks for that info @aduth. Yeah unfortunately I don't know enough about the motivation for enforcing that we do these calls async. This might be a good thing to bring back to our team and see what folks think.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea with See also: identity-idp/config/initializers/ext_action_mailer.rb Lines 14 to 20 in 21d5b41
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. digging back through some old prs and it looks like we previously made the decision to use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I generally don't like the pattern of So, in the end, unless others object, I would support leaving this as-is. I'd rather the file stay consistent, even if it's not strictly necessary in this case. |
||||||||||||||||
| UserMailer.with(user: user, email_address: email_address).in_person_please_call( | ||||||||||||||||
| enrollment: enrollment, | ||||||||||||||||
| ).deliver_later(**notification_delivery_params(enrollment)) | ||||||||||||||||
| # rubocop:enable IdentityIdp/MailLaterLinter | ||||||||||||||||
| end | ||||||||||||||||
| end | ||||||||||||||||
|
|
||||||||||||||||
| # enqueue sms notification job when it's expired or success | ||||||||||||||||
| # @param [InPersonEnrollment] enrollment | ||||||||||||||||
| def send_enrollment_status_sms_notification(enrollment:) | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <%= image_tag( | ||
| asset_url('email/phone_icon.png'), | ||
| alt: t('image_description.phone_icon'), | ||
| width: 88, | ||
| height: 88, | ||
| ) %> | ||
| <h1><%= t('user_mailer.in_person_please_call.header') %></h1> | ||
| <p> | ||
| <%= t( | ||
| 'user_mailer.in_person_please_call.body.intro_html', | ||
| date: I18n.l(14.days.from_now, format: I18n.t('time.formats.event_date')), | ||
| ) %> | ||
| </p> | ||
| <p> | ||
| <%= t( | ||
| 'user_mailer.in_person_please_call.body.contact_message_html', | ||
| contact_number: IdentityConfig.store.idv_contact_phone_number, | ||
| support_code: IdentityConfig.store.lexisnexis_threatmetrix_support_code, | ||
| ) %> | ||
| </p> | ||
|
|
Uh oh!
There was an error while loading. Please reload this page.