Skip to content

Conversation

rgraber
Copy link
Contributor

@rgraber rgraber commented May 29, 2025

πŸ—’οΈ Checklist

  1. run linter locally
  2. update all related docs (API, README, inline, etc.), if any
  3. draft PR with a title <type>(<scope>)<!>: <title> TASK-1234
  4. tag PR: at least frontend or backend unless it's global
  5. fill in the template below and delete template comments
  6. review thyself: read the diff and repro the preview as written
  7. open PR & confirm that CI passes
  8. request reviewers, if needed
  9. delete this section before merging

πŸ“£ Summary

Allow one-off emails to be resent if they have completely finished sending.

πŸ’­ Notes

Once a one-off email has records enqueued, set the 'live' flag to read-only so it can not be set to False and then re-added until all enqueued records have been sent. Once all records are sent for a one-off email, set live to False so it is clear that it is no longer sending and allow users to re-add it to the send list another day.

πŸ‘€ Preview steps

Use mailhog or file-backed email send for easier testing.

  1. ℹ️ have at least superuser account and one other account
  2. Make sure MASS_EMAILS_CONDENSE_SEND is True
  3. Set MAX_MASS_EMAILS_PER_DAY to 1
  4. In admin, add two user emails to Constance > Config > MASS_EMAIL_TEST_EMAILS
  5. Create a new MassEmailConfigs, with the 'test_users' query and a frequency of -1. Don't check 'live'
  6. Add the new config to the daily send using the admin action
  7. The new config should now show as live in the list view
  8. 🟒 At the next 15-minute boundary (:00, :15, :30, or :45) (give or take a minute), the first user should receive the email
  9. Before the next 15 minute boundary, go to the config in Django admin
  10. 🟒 The 'live' field should be read-only
  11. Try to add the config to the daily send again using the admin action
  12. 🟒 You should get an error message "Emails for {config.name} have already been scheduled"
  13. 🟒 At the next 15 minute boundary, the second user should receive the email
  14. Go back to the config in Django admin. 'live' should now be unchecked
  15. Try to add the config to the daily send again
  16. 🟒 The config should be successfully added to the next "day"'s send

@rgraber rgraber marked this pull request as ready for review June 9, 2025 13:57
@rgraber rgraber requested review from jnm and noliveleger as code owners June 9, 2025 13:57
@rgraber rgraber marked this pull request as draft June 9, 2025 14:01
@rgraber rgraber removed request for jnm and noliveleger June 9, 2025 14:01
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.

1 participant