@softeneers/email
v0.1.0
Published
Transactional email for Softeneers projects: a Resend client, sendEmail, and React Email templates.
Readme
@softeneers/email
Transactional email for Softeneers projects: a Resend
client, a sendEmail helper, and ready-made React Email
templates.
Usage
import { createEmailClient, sendEmail, WelcomeEmail } from "@softeneers/email";
const email = createEmailClient(env.RESEND_API_KEY);
await sendEmail(email, {
from: "[email protected]",
to: user.email,
subject: "Welcome!",
react: WelcomeEmail({ name: user.name, productName: "YourApp" }),
});API
createEmailClient(apiKey)— a Resend client (no network call on construct).sendEmail(client, { from, to, subject, react | html | text })— renders a React template to HTML whenreactis given; throws if none of react/html/text.- Templates:
WelcomeEmail,ResetPasswordEmail(extend with your own). - Re-exports
render(React Email) andResend.
Pair with @softeneers/env to validate RESEND_API_KEY.
