Skip to content

LG-8856: Account for polling delays when sending in-person proofing emails#7805

Merged
sheldon-b merged 12 commits intomainfrom
sbachstein/send-in-person-proofing-results-emails-sooner
Mar 1, 2023
Merged

LG-8856: Account for polling delays when sending in-person proofing emails#7805
sheldon-b merged 12 commits intomainfrom
sbachstein/send-in-person-proofing-results-emails-sooner

Conversation

@sheldon-b
Copy link
Contributor

@sheldon-b sheldon-b commented Feb 10, 2023

🎫 Ticket

LG-8856

🛠 Summary of changes

  • Begin sending a proofing failed email when a user's in-person proofing attempt fails because they used an unsupported type of ID
  • Reduce the delay in sending success/failure emails to users when possible, eg when we don't retrieve the enrollment's updated status until long after the user's transaction has completed
  • Add a proofed_at timestamp to enrollments. When an enrollment succeeds or fails we will set this timestamp based on the transaction timestamp retrieved from USPS

changelog: User-facing Improvements, In-person proofing, reduce delay when sending proofing emails to users if their enrollment hasn't been updated in a while

changelog: User-facing Improvements, In-person proofing, reduce delay
when sending proofing emails to users if their enrollment hasn't been
updated in a while
Comment on lines +234 to +238
send_failed_email(enrollment.user, enrollment)
analytics(user: enrollment.user).idv_in_person_usps_proofing_results_job_email_initiated(
**email_analytics_attributes(enrollment),
email_type: 'Failed unsupported ID type',
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ We weren't previously sending emails when a user failed to proof due to an unsupported type of ID

Comment on lines +39 to +40
transaction_end_date_time: anything,
transaction_start_date_time: anything,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are verified below in specific tests since not all tests will set these values (eg expired enrollments)

@sheldon-b sheldon-b marked this pull request as ready for review February 14, 2023 18:41
@sheldon-b sheldon-b requested review from a team and tomas-nava February 16, 2023 18:25
@sheldon-b
Copy link
Contributor Author

I tested this change in the Joy sandbox. I created a new enrollment, asked USPS to set the enrollment to passed. I was able to confirm that the enrollment was set to passed at 13:16:19, the polling job ran at 13:30, and the email was sent at 14:16:19. That's with a 1 hour delay configured

@sheldon-b sheldon-b merged commit 6c28c2b into main Mar 1, 2023
@sheldon-b sheldon-b deleted the sbachstein/send-in-person-proofing-results-emails-sooner branch March 1, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants