send email after donation received#46
Merged
Merged
Conversation
iulusoy
commented
Apr 29, 2026
Member
- refactor email sending so donation re-uses same actions
- type checking and improvement of donation form
- rate limiting of requests
- success / failure handling in the donation form
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors email sending into a shared server utility and extends the donation flow to record a donation UUID and send a confirmation email, while adding request rate limiting and improved success/failure handling in the donation UI.
Changes:
- Add donation UUID persistence + confirmation email sending with rollback behavior on send failure.
- Refactor contact form email sending to reuse shared SMTP/email utilities.
- Add Nginx rate limiting for POSTs to
/contactand/donation, plus donation UI alert handling and new unit tests.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/nginx/conf/nginx.conf | Adds POST-only rate limiting for contact/donation endpoints and centralizes proxy headers. |
| src/frontend/src/routes/donation/page.server.test.ts | Adds unit tests covering donation action validation, DB insert, email send, and rollback paths. |
| src/frontend/src/routes/donation/+page.svelte | Adds submission state + localized alert handling for donation success/failure and a honeypot field. |
| src/frontend/src/routes/donation/+page.server.ts | Implements donation UUID generation, input validation, SMTP config validation, email confirmation, and rollback on send failure. |
| src/frontend/src/routes/contact/+page.server.ts | Switches contact action to shared SMTP/email utilities and structured from handling. |
| src/frontend/src/lib/server/schema.ts | Adds uuid column and unique index to donations table schema. |
| src/frontend/src/lib/server/email.ts | Introduces shared SMTP config validation, email validation helpers, and transporter creation. |
| src/frontend/src/lib/i18n/translations.ts | Adds donation alert translations and adds cross-locale structural type checks. |
| src/frontend/package.json | Adds a smoke-test Playwright script entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.


