Email & Uploads
Handlebars-templated transactional email via the Mailer, plus ImageKit upload auth.
Mailer (transactional email)
lib/mailer.ts (class Mailer) wraps nodemailer with a Handlebars template registry. SMTP transport is configured from the SMTP_* env vars.
import { Mailer } from "@/plugins/Huruf-Tech/thunder-core/lib/mailer.ts";
// Register a named template (lazy fetcher; cached after first render).
Mailer.addTemplate("welcome", () => ({
subject: "Welcome {{name}}",
html: "<h1>Hi {{name}}</h1>",
}));
// Send using a template (extra fields are passed to Handlebars), or raw html/text.
await Mailer.send({ template: "welcome", to: "a@b.com", name: "Alice" });
await Mailer.send({ to: "a@b.com", subject: "Hi", html: "<p>...</p>" });A _blank template id is used as a fallback when a requested template isn't registered. thunder-core itself uses the Mailer for password-reset and magic-link emails.
ImageKit upload auth
routes/imagekit.ts exposes an endpoint that returns short-lived ImageKit client-side upload credentials, using IMAGEKIT_PRIVATE_KEY / IMAGEKIT_PUBLIC_KEY.
Read routes/imagekit.ts for the exact path and response shape. Your frontend uses these credentials to upload directly to ImageKit without proxying files through your server.