chore(functions): switch outbound email from SendGrid to Brevo - #46
Merged
Merged
Conversation
Replace @sendgrid/mail with a Brevo transactional API call (Node 20 global fetch, no SDK dependency). Preserves contractor-only gate, input validation, CC, PDF attachment, and PII-safe error logging. Secret renamed SENDGRID_API_KEY to BREVO_API_KEY.
|
🔥 Firebase Hosting preview: https://open-ten99--pr-46-gol4w83x.web.app |
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.
Why
Switching outbound email provider to Brevo (from SendGrid).
What
functions/src/sendCompletionEmail.ts— replaced@sendgrid/mailwith aPOST https://api.brevo.com/v3/smtp/emailcall using Node 20 globalfetch(no SDK dependency). Same callable interface (to/toName/cc/subject/fromEmail/fromName/html/pdfBase64/pdfFilename) so web needs no change. Preserved: contractor-only auth gate, input validation, CC filtering, PDF attachment, PII-safe structured error logging.SENDGRID_API_KEY→BREVO_API_KEY(defineSecret).@sendgrid/maildependency; updated.env.example; gitignored.claude-flow/.Inbound Postmark parsing is unrelated and untouched.
Required before this works (owner)
firebase functions:secrets:set BREVO_API_KEYdevin@dwtailored.com/ dwtailored.com domain) in Brevofirebase deploy --only functions:sendCompletionEmailTest plan
functionsnpm run build(tsc) cleandevin@dwtailored.com, CC delivered, PDF attached