@svforge/email
v2.0.1
Published
SVForge Email — transactional emails via Resend
Maintainers
Readme
@svforge/email
Transactional emails for SVForge projects via Resend. Adds a sendEmail() helper, Resend client setup, and reusable email templates.
Installation
npx sv add @svforge/emailDeployment profile
Supported: long-lived-node, serverless, edge, separate-worker. Unsupported: none. Trigger delivery from a request or a dedicated worker; keep RESEND_API_KEY server-side.
Setup
Add your Resend API key to .env:
RESEND_API_KEY=re_xxxxxxxxUsage
import { sendEmail } from '$lib/server/email';
import { welcomeEmailHtml } from '$lib/server/templates';
await sendEmail({
to: '[email protected]',
subject: 'Welcome!',
html: welcomeEmailHtml('Alice')
});API
sendEmail(options)
Sends an email via Resend.
| Parameter | Type | Default |
|-----------|------|---------|
| to | string \| string[] | — |
| subject | string | — |
| html | string | — |
| from | string | [email protected] |
Templates
Pre-built HTML email templates:
welcomeEmailHtml(name)— welcome email for new usersresetPasswordEmailHtml(resetUrl)— password reset with styled CTA button
import { welcomeEmailHtml, resetPasswordEmailHtml } from '$lib/server/templates';What's included
$lib/server/email.ts— Resend client +sendEmail()helper$lib/server/templates/— welcome and reset-password email templates
Dependencies
resend— official Resend Node.js SDK
