feat(email): phase 6 — replace Resend with Brevo transactional email
Removes resend npm dependency. Adds lib/notifications/mailer.ts with a raw-HTTP Brevo wrapper (sendEmail + sendPasswordResetEmail). All three notification files updated to use the new wrapper. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import 'server-only'
|
||||
import { Resend } from 'resend'
|
||||
import { sendEmail } from '@/lib/notifications/mailer'
|
||||
import { asAdmin } from '@/lib/db/with-user'
|
||||
import { users, incidents, sites } from '@/lib/db/schema'
|
||||
import { and, eq, inArray } from 'drizzle-orm'
|
||||
@@ -55,9 +55,5 @@ export async function sendNewIncidentEmail(
|
||||
incident_id: incidentId,
|
||||
})
|
||||
|
||||
const resend = new Resend(process.env.RESEND_API_KEY)
|
||||
const from = process.env.RESEND_FROM_EMAIL ?? 'onboarding@resend.dev'
|
||||
|
||||
const { error } = await resend.emails.send({ from, to, subject, html, text })
|
||||
if (error) console.error('Resend error:', error)
|
||||
await sendEmail({ to, subject, html, text })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user