Skip to content

Send emails for weekly submission batches#1975

Merged
stephencdaly merged 5 commits intomainfrom
add-job-to-send-weekly-csv
Mar 18, 2026
Merged

Send emails for weekly submission batches#1975
stephencdaly merged 5 commits intomainfrom
add-job-to-send-weekly-csv

Conversation

@stephencdaly
Copy link
Contributor

@stephencdaly stephencdaly commented Mar 18, 2026

What problem does this pull request solve?

Trello card: https://trello.com/c/v2LQDGgq/

Add a new "weekly" delivery schedule.

Modify SendSubmissionBatchJob to also be able to send weekly deliveries. This sends the email with placeholder content for the email body and attachment file names that will be updated when the content is designed.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

@stephencdaly stephencdaly force-pushed the add-job-to-send-weekly-csv branch 2 times, most recently from ab73a04 to ac8af80 Compare March 18, 2026 10:59
@stephencdaly stephencdaly changed the title Add job to send weekly csv Send emails for weekly batches Mar 18, 2026
@stephencdaly stephencdaly changed the title Send emails for weekly batches Send emails for weekly submission batches Mar 18, 2026
Rename send_batch to send_daily_batch and provide the date as an
argument to the method, rather than when initializing the service.

We will add a separate method to send weekly batches.
We are adding the ability to send weekly batches, so rename the
existing mailer to make it clear that it is for daily batches.
This email uses placeholder content for now, re-using the same content
as the daily batch email where possible. This will be updated when the
actual content is produced.
Add a method that generates the CSV(s) for the defined date range and
sends the email with them attached.

We haven't decided what the CSV filenames will be for weekly
submissions yet, so for now keep them the same as for the daily
submissions using the the end date of the range. We can update this
when it's decided.
Check the delivery_schedule for the delivery, and call the appropriate
method to send the email. Update the logging to log different events
for daily and weekly deliveries.
@stephencdaly stephencdaly force-pushed the add-job-to-send-weekly-csv branch from ac8af80 to 48d30e4 Compare March 18, 2026 12:01
@stephencdaly stephencdaly changed the base branch from main to add-batch-begin-at March 18, 2026 12:01
@sonarqubecloud
Copy link

Base automatically changed from add-batch-begin-at to main March 18, 2026 12:04
@stephencdaly stephencdaly marked this pull request as ready for review March 18, 2026 12:06
@github-actions
Copy link
Contributor

🎉 A review copy of this PR has been deployed! It is made of up two components

  1. A review copy of forms-runner
  2. A production copy of forms-admin

Important

Not all of the functionality of forms-runner is present in review apps.
Functionality such as sending emails, file upload, and S3 submission types are
deliberately disabled for the sake of simplifying review apps.

You should use the full dev environment to test the functionality which is disabled here.

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

Copy link
Contributor

@SamJamCul SamJamCul left a comment

Choose a reason for hiding this comment

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

Looking good!

@stephencdaly stephencdaly added this pull request to the merge queue Mar 18, 2026
Merged via the queue into main with commit 2dcf2a9 Mar 18, 2026
9 checks passed
@stephencdaly stephencdaly deleted the add-job-to-send-weekly-csv branch March 18, 2026 16:30
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.

2 participants