Remove API route; submit to Brevo directly from client with fetch fallback#990
Draft
Remove API route; submit to Brevo directly from client with fetch fallback#990
Conversation
…roach) Co-authored-by: bobbyiliev <21223421+bobbyiliev@users.noreply.github.com>
Deploying devops-daily with
|
| Latest commit: |
55217ad
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d35d3adb.devops-daily.pages.dev |
| Branch Preview URL: | https://copilot-fix-brevo-style-issu.devops-daily.pages.dev |
Copilot
AI
changed the title
[WIP] Fix Brevo styles to match site design
Switch newsletter from Mailchimp to Brevo, keep existing styles
Mar 5, 2026
… lib/newsletter.ts Co-authored-by: bobbyiliev <21223421+bobbyiliev@users.noreply.github.com>
Copilot
AI
changed the title
Switch newsletter from Mailchimp to Brevo, keep existing styles
Switch newsletter from Mailchimp to Brevo
Mar 5, 2026
Co-authored-by: bobbyiliev <21223421+bobbyiliev@users.noreply.github.com>
Copilot
AI
changed the title
Switch newsletter from Mailchimp to Brevo
Hardcode Brevo form URL instead of env var
Mar 5, 2026
Co-authored-by: bobbyiliev <21223421+bobbyiliev@users.noreply.github.com>
Copilot
AI
changed the title
Hardcode Brevo form URL instead of env var
Fix newsletter subscribe navigating to blank Brevo page
Mar 5, 2026
Co-authored-by: bobbyiliev <21223421+bobbyiliev@users.noreply.github.com>
Co-authored-by: bobbyiliev <21223421+bobbyiliev@users.noreply.github.com>
Copilot
AI
changed the title
Fix newsletter subscribe navigating to blank Brevo page
Remove API route; submit to Brevo directly from client with fetch fallback
Mar 5, 2026
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.
Newsletter subscription was routed through a Next.js API handler (
/api/newsletter). The requirement is no API routes — submit directly to Brevo's hosted form endpoint from the client.Changes
lib/newsletter.tsEMAIL_REregex andsubmitToBrevo(email)helperapplication/x-www-form-urlencodeddirectly toBREVO_FORM_URLwithmode: 'no-cors'(Brevo's endpoint doesn't emit CORS headers; response is opaque so any non-throwing fetch is treated as success)hooks/use-newsletter-subscribe.ts/api/newsletterfetch withsubmitToBrevo()BREVO_FORM_URLin a new tab so the user is guaranteed to reach the formcomponents/book-promotion-popup.tsxsubmitToBrevo()call replacing the previous/api/newsletterfetchwindow.open(BREVO_FORM_URL, '_blank')fallback with null-check for popup blockersapp/api/newsletter/route.ts💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.