Skip to content

src/utils/email.ts is dead code and drags nodemailer along with it #45

Description

@royalpinto007

Desired outcome

src/utils/email.ts and the nodemailer dependency are removed, or the module is actually wired up.

Why it matters

src/utils/email.ts exports sendEmail() built on nodemailer and a smtpOptions block reading EMAIL_SERVER_HOST, EMAIL_SERVER_PORT, EMAIL_SERVER_USER, EMAIL_SERVER_PASSWORD, and EMAIL_FROM. A grep across src/ shows nothing imports it:

$ grep -rn "sendEmail\|utils/email" src
src/utils/email.ts:20:export const sendEmail = async (data: EmailPayload) => {

The contact form does not use it either. src/components/Contact/useContactForm.ts posts to ${apiBaseUrl}/api/contact on a separate API host.

The cost is real: nodemailer and @types/nodemailer stay in package.json for nothing, the file still carries the placeholder comment "Replace with your SMTP credentials", and .env.example implies SMTP configuration this site never performs. It also sets a trap for anyone who "fixes" the contact form by calling it and discovers nodemailer does not run on the Cloudflare/next-on-pages runtime this project targets.

Steps

  1. Confirm nothing imports src/utils/email.ts (the grep above).
  2. Delete the file, remove nodemailer and @types/nodemailer from package.json, and refresh the lockfile.
  3. Remove the now-unused EMAIL_SERVER_* and EMAIL_FROM entries from .env.example.
  4. If the module is intentionally kept for a planned feature, say so in a comment instead and close this.

Claiming this

Comment below to claim it. A reply usually comes within a day.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions