Skip to content

LG-7185: Send email reminders for in-person proofing enrollments#7256

Merged
svalexander merged 40 commits intomainfrom
shannon/lg-7185-email-reminders-job-new
Nov 29, 2022
Merged

LG-7185: Send email reminders for in-person proofing enrollments#7256
svalexander merged 40 commits intomainfrom
shannon/lg-7185-email-reminders-job-new

Conversation

@svalexander
Copy link
Contributor

@svalexander svalexander commented Oct 31, 2022

LG-7185

🛠 Summary of changes
This pr is to add the job for the email reminder. This job is to run daily. The job checks enrollments that fit the database query in needs_email_reminders - these are enrollments that have a pending status, have an established_at date and have at least 11 days left till their enrollment period ends.

📜 Testing Plan
Provide a checklist of steps to confirm the changes.

Open the rails console

  1. Save your latest enrollment, e = InPersonEnrollment.last
  2. Update the enrollment so it has 11 days left:
# assuming enrollment_established_at == created_at
e.update!(enrollment_established_at: e.created_at - 19.days)
# check how many days are left
e.days_to_due_date
=> 11
  1. Update enrollment status to "pending" if it isn't already, e.update(status: "pending")
  2. Trigger job: InPerson::EmailReminderJob.new.perform(Time.zone.now)
  3. Check that you received an email in mailcatcher
  4. Update enrollment so it now has 4 days left.
# assuming enrollment_established_at == created_at
e.update!(enrollment_established_at: e.created_at - 26.days)
# check how many days are left
e.days_to_due_date
=> 4
  1. Trigger job again and confirm email was sent to mailcatcher

👀 Screenshots

en- 10 days:
en- 3 days:
en- 1 day:
es- 10 days:
es- 3 days:
es- 1 day:
fr- 10 days:
fr- 3 days:
fr- 1 day:

@tomas-nava tomas-nava mentioned this pull request Nov 1, 2022
4 tasks
@svalexander svalexander changed the title DRAFT Shannon/lg 7185 email reminders job new Shannon/lg 7185 email reminders job new Nov 7, 2022
email_address: email_address,
).in_person_ready_to_verify_reminder(
enrollment: enrollment,
).deliver_now
Copy link
Contributor Author

Choose a reason for hiding this comment

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

would there be any issues if there were a large number of emails being sent using deliver_now - 500+? Anything to consider here?

Copy link
Contributor

Choose a reason for hiding this comment

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

deliver_now would mean that we'd email synchronously in the job, so that would increase how long this job takes to run, worst case, it would take too long and collide with the next run of the job?

@tomas-nava tomas-nava changed the title Shannon/lg 7185 email reminders job new LG-7185: Send email reminders for in-person proofing enrollments Nov 21, 2022
Tomas Apodaca and others added 4 commits November 21, 2022 14:02
… reminder job (#7364)

* add new analytics events

* add analytics and error handling to job

* add analytics expectations to tests

* add test for error handling (currently failing)

* job refactor

* remove put statement

* error is raised but occurs 2x

* execption logged test passes

* separate error test for clarity

* fix lint by documenting parameter

* fix spelling

Co-authored-by: Shannon Alexander <shannon.alexander-navarro@gsa.gov>
we might send the email when there's only one day left
@tomas-nava tomas-nava requested review from a team, kellular and lizzieamanning and removed request for a team and kellular November 23, 2022 20:56
@@ -0,0 +1,95 @@
# frozen_string_literal: true
Copy link
Contributor

@lizzieamanning lizzieamanning Nov 23, 2022

Choose a reason for hiding this comment

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

looks good! starting a thread here arbitrarily for small design comments @tomas-nava

  1. Can we shift which text we are linking in the bottom of the box outlining items to bring from "Questions about what to bring? Learn more" to "Questions? Learn more about what to bring." (indicating what text should be linked here with bold). Also linking this design that accurately reflects what I mean. I also believe our link style uses an underline, if we could add that here.
  2. Are we able to add more space between the sentence "You can see any associate at the retail window to verify your identity" and "Your deadline to verify your identity in person is..." at the bottom of the email to more accurately reflect the design above as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

created LG-8207 to track this work

@svalexander svalexander merged commit 3a230e8 into main Nov 29, 2022
@svalexander svalexander deleted the shannon/lg-7185-email-reminders-job-new branch November 29, 2022 19:02
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.

5 participants