Skip to content

chore(functions): switch outbound email from SendGrid to Brevo - #46

Merged
Dev869 merged 1 commit into
mainfrom
chore/brevo-email
May 19, 2026
Merged

Dev869 merged 1 commit into
mainfrom
chore/brevo-email

Conversation

@Dev869

@Dev869 Dev869 commented May 19, 2026

Copy link
Copy Markdown
Owner

Why

Switching outbound email provider to Brevo (from SendGrid).

What

  • functions/src/sendCompletionEmail.ts — replaced @sendgrid/mail with a POST https://api.brevo.com/v3/smtp/email call using Node 20 global fetch (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.
  • Secret SENDGRID_API_KEYBREVO_API_KEY (defineSecret).
  • Removed @sendgrid/mail dependency; updated .env.example; gitignored .claude-flow/.

Inbound Postmark parsing is unrelated and untouched.

Required before this works (owner)

  • firebase functions:secrets:set BREVO_API_KEY
  • Verify the sender (devin@dwtailored.com / dwtailored.com domain) in Brevo
  • Deploy: firebase deploy --only functions:sendCompletionEmail

Test plan

  • functions npm run build (tsc) clean
  • Live send: invoice email arrives via Brevo from devin@dwtailored.com, CC delivered, PDF attached

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.
@github-actions

Copy link
Copy Markdown

🔥 Firebase Hosting preview: https://open-ten99--pr-46-gol4w83x.web.app
(expires in 7 days)

@Dev869
Dev869 merged commit 3c61089 into main May 19, 2026
3 checks passed
@Dev869
Dev869 deleted the chore/brevo-email branch May 19, 2026 01:59
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.

1 participant