Add Reply-To header to contact form email notifications #5

Merged
Copilot merged 3 commits from copilot/fix-9fe61eec-3938-4954-ae97-5faf43c62bbb into master 2025-07-02 10:12:58 +02:00
Copilot commented 2025-07-02 09:44:46 +02:00 (Migrated from github.com)

Problem

The contact form backend was sending email notifications without a Reply-To header, causing replies to go to the SMTP user account instead of the person who submitted the form. This made it difficult to respond directly to contact form submissions.

Solution

Added a replyTo field to the transporter.sendMail() configuration in src/app/api/contact/route.ts that uses the validated email address from the form submission.

Changes

  • Single line addition: replyTo: email, in the email configuration
  • Uses the already-validated email variable from the form data
  • Applies to both text and HTML email formats
await transporter.sendMail({
  from: `"Contact Form" <${env.SMTP_USER}>`,
  to: env.SMTP_TO_ADDRESS,
+ replyTo: email,
  subject: `New Contact Form Submission from ${name}`,
  // ... rest of email configuration
});

Impact

Before: Replies to contact form notifications went to the SMTP user (e.g., noreply@domain.com)
After: Replies now go directly to the form submitter's email address

This enables natural email conversations with people who contact you through the website form.

Testing

  • Linting passes with no errors
  • TypeScript compilation successful
  • Build completes successfully
  • Email configuration verified to include Reply-To header
  • Minimal change with no breaking modifications

Closes the issue regarding Reply-To header functionality in contact form emails.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Aiko-IT-Systems/DisCatSharp
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Pycord-Development/pycord
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/SebiAi/GlyphVisualizer
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/SebiAi/custom-nothing-glyph-tools
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/MultipackParser
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/Nyaaa-Bot
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/TicTacToe
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/TicTacToeTcpIpReceiver
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/Uebungen-Csharp-Clos
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/Uebungen-etc
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/carrd-miizu-site
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/heymiizu-fm-site
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/snupai-site
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/some_bot
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/tcp-ip-comm
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)
  • https://api.github.com/repos/Snupai/visualize_MultiPack
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

## Problem The contact form backend was sending email notifications without a Reply-To header, causing replies to go to the SMTP user account instead of the person who submitted the form. This made it difficult to respond directly to contact form submissions. ## Solution Added a `replyTo` field to the `transporter.sendMail()` configuration in `src/app/api/contact/route.ts` that uses the validated email address from the form submission. ## Changes - **Single line addition**: `replyTo: email,` in the email configuration - Uses the already-validated `email` variable from the form data - Applies to both text and HTML email formats ```typescript await transporter.sendMail({ from: `"Contact Form" <${env.SMTP_USER}>`, to: env.SMTP_TO_ADDRESS, + replyTo: email, subject: `New Contact Form Submission from ${name}`, // ... rest of email configuration }); ``` ## Impact **Before**: Replies to contact form notifications went to the SMTP user (e.g., `noreply@domain.com`) **After**: Replies now go directly to the form submitter's email address This enables natural email conversations with people who contact you through the website form. ## Testing - ✅ Linting passes with no errors - ✅ TypeScript compilation successful - ✅ Build completes successfully - ✅ Email configuration verified to include Reply-To header - ✅ Minimal change with no breaking modifications Closes the issue regarding Reply-To header functionality in contact form emails. > [!WARNING] > > <details> > <summary>Firewall rules blocked me from connecting to one or more addresses</summary> > > #### I tried to connect to the following addresses, but was blocked by firewall rules: > > - `https://api.github.com/repos/Aiko-IT-Systems/DisCatSharp` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Pycord-Development/pycord` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/SebiAi/GlyphVisualizer` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/SebiAi/custom-nothing-glyph-tools` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/MultipackParser` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/Nyaaa-Bot` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/TicTacToe` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/TicTacToeTcpIpReceiver` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/Uebungen-Csharp-Clos` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/Uebungen-etc` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/carrd-miizu-site` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/heymiizu-fm-site` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/snupai-site` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/some_bot` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/tcp-ip-comm` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > - `https://api.github.com/repos/Snupai/visualize_MultiPack` > - Triggering command: `/usr/local/bin/node /home/REDACTED/work/snupai-site/snupai-site/node_modules/next/dist/compiled/jest-worker/processChild.js` (http block) > > If you need me to access, download, or install something from one of these locations, you can either: > > - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled > - Add the appropriate URLs or hosts to my [firewall allow list](https://gh.io/copilot/firewall-config) > > </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.
vercel[bot] commented 2025-07-02 09:44:48 +02:00 (Migrated from github.com)

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
snupai-site Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2025 7:51am
[vc]: #ilVq+o369pY2L7EzdkPKjQ6goaWlqlFp6C9gY/2eHzI=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJzbnVwYWktc2l0ZSIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9zbnVwYWkvc251cGFpLXNpdGUvQVZOb3NCWnVEYUxwem1HOGRuVFRURHlqMTZMaiIsInByZXZpZXdVcmwiOiJzbnVwYWktc2l0ZS1naXQtY29waWxvdC1maXgtOWZlNjFlZWMtMzkzOC00OTU0LWFlLTU2YjBmMi1zbnVwYWkudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJzbnVwYWktc2l0ZS1naXQtY29waWxvdC1maXgtOWZlNjFlZWMtMzkzOC00OTU0LWFlLTU2YjBmMi1zbnVwYWkudmVyY2VsLmFwcCJ9LCJyb290RGlyZWN0b3J5IjpudWxsfV19 **The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more) | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **snupai-site** | ✅ Ready ([Inspect](https://vercel.com/snupai/snupai-site/AVNosBZuDaLpzmG8dnTTTDyj16Lj)) | [Visit Preview](https://snupai-site-git-copilot-fix-9fe61eec-3938-4954-ae-56b0f2-snupai.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/snupai-site-git-copilot-fix-9fe61eec-3938-4954-ae-56b0f2-snupai.vercel.app?via=pr-comment-feedback-link) | Jul 2, 2025 7:51am |
Snupai (Migrated from github.com) approved these changes 2025-07-02 10:09:49 +02:00
Sign in to join this conversation.
No description provided.