Repository navigation
Always send email from the configured sender; staff set Reply-To - #185
Merged
Merged
Conversation
The email page let staff type any From address, and mail went out through the university's SMTP account under it. Now every email (to students and test emails) is sent from EMAIL_SENDER, which the page shows read-only. Staff can set an optional Reply-To so replies still reach the course. CC and BCC are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🚀 Staging Preview Deployed! URL: https://preview-seating-pr-185-137456085712.us-west1.run.app |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #185 +/- ##
==========================================
+ Coverage 92.70% 92.97% +0.26%
==========================================
Files 36 36
Lines 2756 2774 +18
==========================================
+ Hits 2555 2579 +24
+ Misses 201 195 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Without EMAIL_SENDER, emails would have gone out with an empty From. The email pages now say no sender is set up and disable the send buttons; a post anyway is refused before anything is sent, and building an email without a sender raises. Reply-To is stripped of surrounding whitespace. Tests cover an unset, empty and blank sender on every send path, a forged From through the full-page and single-student forms, and that a list in Reply-To is an error on that field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #179
The email page had a FROM field, and mail went out through the university's SMTP account with whatever address staff typed there. Now every email is sent from the configured sender (
EMAIL_SENDER), and staff can set an optional Reply-To so replies still reach the course (for example a course SPA's address).Changes
EMAIL_SENDERas From. Afrom_addrsent with the form is ignored.from_addrfield is replaced byreply_to: optional, and if given it must be a single valid address. Surrounding whitespace is stripped.construct_emailadds aReply-Toheader only when one is given.EMAIL_SENDERis unset, empty or blank, emails would go out with an empty From. Instead:name, so it isn't submitted. REPLY-TO sits next to it, and TO now has its own row.TestingConfigsets a sender, so tests don't depend on the local environment..env.samplesays whatEMAIL_SENDERis used for.Tests
New
tests/unit/test_email_sender.py:from_addrnever shows up in the message, through the batch endpoint, the full-page form or the single-student formreply_toExisting email tests post
reply_toinstead offrom_addr, and the e2e tests type intoreply_to.All unit tests and the email e2e and a11y tests pass locally. The one exception is
test_dev_login.py::TestRealCanvas::test_login_redirects_to_real_canvas, which fails the same way onmainwith my local.env.🤖 Generated with Claude Code