@porulle/adapter-resend
v0.10.8
Published
Transactional email via Resend. Implements the email.send callback in CommerceConfig.
Readme
@porulle/adapter-resend
Transactional email via Resend. Implements the email.send callback in CommerceConfig.
Usage
import { defineConfig } from "@porulle/core";
import { resendEmailAdapter } from "@porulle/adapter-resend";
export default defineConfig({
email: {
send: resendEmailAdapter({
apiKey: process.env.RESEND_API_KEY!,
from: "Acme Store <[email protected]>",
// Optional: per-template subject + HTML overrides
subjects: {
"order-confirmation": (d) => `Your order ${d.orderNumber} is confirmed`,
},
templates: {
"order-confirmation": (d) => `<p>Thanks for ordering ${d.itemCount} items.</p>`,
},
// Optional: use Resend's server-side templates instead of local HTML
resendTemplateIds: {
"order-confirmation": "tmpl_abc123",
},
}),
},
// …
});What gets sent
The kernel emits emails via the email.send callback for:
email-verification— Better Auth signuppassword-reset— Better Auth password resetorder-confirmation—orders.afterCreate- (plugins can add their own — see plugin docs)
Templates not in subjects / templates get a minimal fallback so nothing silently fails to render.
See also
- Resend docs
@porulle/adapter-ses— AWS SES alternative
