Skip to content

fix: junk email + email verification page#118

Merged
Alessandro100 merged 4 commits intomainfrom
fix/105-email-validation-junk
Apr 16, 2026
Merged

fix: junk email + email verification page#118
Alessandro100 merged 4 commits intomainfrom
fix/105-email-validation-junk

Conversation

@Alessandro100
Copy link
Copy Markdown
Contributor

@Alessandro100 Alessandro100 commented Apr 15, 2026

Summary:

closes #105

When a user creates a new account, the validation email will go to the junk box with many users missing it entirely. This PR + fixes externally gives more credibility to the email validation so that mail services do not view it as spam

changes

  • the email is now sent from @mobilitydatabase.org instead of @mobility-feeds-dev.firebaseapp.com (done in firebase console)
  • the action link points to the mobilitydatabase /email-verification page (new in this PR) which gives it better styling to the verification page but also better domain authority in the email

Important notes

  • Firebase will not allow us to edit the email verification template for spam reasons. If we want a more custom email template we will have to implement a custom solution
  • Even after these changes, the email is still going to junk in outlook (works for gmail).
  • For dev it will send from mobilitydatabase.org but it will not use the new email-verification

Outlook

Our email has X-MS-Exchange-Organization-SCL: 5 which is microsoft way of detecting spammy emails. The rating is 0-9, 5 triggers a junk email. Maybe in PROD not having the words (dev) will push us to a 4 which will not mark as junk. If this doesn't work, the next steps would be a custom email

Next Steps

If changing the sender to mobilitydatabase and changing the internal link to mobilitydatabase does not work, the next step would be to create a custom, less spammy looking email.

Once this PR goes in and works well on staging, there will be a frontend release, and then the settings will change for prod

Expected behavior:

When you get any email from the mobilitydatabase it should not go to junk email box.
When verifying your account using the link, it should now send you to
mobilitydatabase.org/email-verification (prod)
staging.mobilitydatabase.org//email-verification (staging)

Testing tips:

This cannot be tested in the preview URL due to the not stable DEV environment for the captcha and for the email link. Test locally by running the dev environment, creating an account

https://mobility-feeds-dev.firebaseapp.com/__/auth/action?mode=verifyEmail&oobCode=0PzwbD3CDQpmeVnkD1MJ5OsH5-i1KtfQSVfpZy_sR5UAAAGdke5L0Q&apiKey=Aqqq&lang=en
change it to
localhost:3000/email-verification?mode=verifyEmail&oobCode=0PzwbD3CDQpmeVnkD1MJ5OsH5-i1KtfQSVfpZy_sR5UAAAGdke5L0Q&apiKey=aaa&lang=en
The reason for this manual change is because DEV does not have a stable URL to put into firebase

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with yarn test to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)
Screenshot 2026-04-15 at 09 21 39 Screenshot 2026-04-15 at 10 06 22 Screenshot 2026-04-15 at 11 49 56 Screenshot 2026-04-15 at 11 50 13 Screenshot 2026-04-15 at 11 50 49 Screenshot 2026-04-15 at 11 51 02

@Alessandro100 Alessandro100 requested a review from Copilot April 15, 2026 16:33
@Alessandro100 Alessandro100 self-assigned this Apr 15, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mobilitydatabase-web Ready Ready Preview, Comment Apr 16, 2026 2:46pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a dedicated, styled email verification landing page in the Next.js App Router so Firebase verification links can direct users to a MobilityDatabase-hosted page (improving perceived legitimacy / domain authority), with localized UI copy.

Changes:

  • Added /email-verification (localized under [locale]) page that reads Firebase action query params and renders a client-side verification flow.
  • Implemented EmailVerificationContent client component to apply the Firebase oobCode and display loading/success/error states.
  • Added emailVerification translation strings in messages/en.json and messages/fr.json.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/app/[locale]/email-verification/page.tsx New server page wiring locale + query params into the verification UI
src/app/[locale]/email-verification/EmailVerificationContent.tsx Client-side Firebase applyActionCode flow and status UI
messages/en.json Added English strings for the verification page
messages/fr.json Added French strings for the verification page

Comment on lines +30 to +35
interface PageProps {
params: Promise<{ locale: string }>;
searchParams: Promise<{
mode?: string;
oobCode?: string;
}>;
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

The page ignores Firebase’s lang query parameter (action links typically include &lang=en|fr). With localePrefix: 'as-needed', users opening /email-verification?...&lang=fr will still resolve to the default en locale unless the URL is /fr/..., so the French verification email/link can land on an English page. Consider accepting lang in searchParams and, when it matches a supported locale and differs from the current route locale, redirecting to the corresponding localized path before rendering.

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +46
setRequestLocale(locale as Locale);

Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

setRequestLocale(locale as Locale) is inconsistent with the rest of the locale pages (they pass locale directly after the [locale] layout validates it). Dropping the cast keeps things consistent and avoids masking potential typing issues.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 15, 2026

*Lighthouse ran on https://mobilitydatabase-aklse3065-mobility-data.vercel.app/ * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 100 🟢 94 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-aklse3065-mobility-data.vercel.app/feeds * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 88 🟠 87 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-aklse3065-mobility-data.vercel.app/feeds/gtfs/mdb-2126 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🔴 49 🟢 94 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-aklse3065-mobility-data.vercel.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 99 🟠 84 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-aklse3065-mobility-data.vercel.app/feeds/gbfs/gbfs-flamingo_porirua * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 86 🟢 94 🟢 96 🟢 100

Comment thread messages/en.json Outdated
@Alessandro100 Alessandro100 merged commit 5ac5166 into main Apr 16, 2026
2 of 3 checks passed
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.

Investigate account creation email validation going to junk

3 participants