Use stored transactional email templates for storefront password resets, with a separate template for sending a generated report as an attachment. The deciding constraint is integration effort: a copy edit shouldn't force changes to token generation or report generation.
Short answer: keep branding and localized copy in reusable templates, preview each variant with fixture data, and let Node.js own security and attachment decisions. A password reset needs a secure one-time token and an expiration window. A report email needs its generated attachment.
Ship weekly.
For a one-person SaaS, the useful measure is revenue per hour of engineering attention. Outsource the undifferentiated. Template maintenance is a decision about how much unrelated work a copy edit can trigger.
What template approach fits password reset email and report attachments?
A storefront has two concrete jobs here: help a customer regain access and deliver a generated report by email. These are proposed implementation fixtures. The first message contains an action whose validity the application must enforce. The second carries an artifact the application has already generated.
Separate the payloads.
The constraint that changes the choice is the report attachment: a template can explain what the customer received, but it cannot stand in for the file itself. Keep report bytes and attachment metadata in the sending layer. Keep the reset token and its expiry in the account layer. Give the renderer only the values it needs to display. This prevents a branding change from dragging the report generator or credential recovery logic into the same release. It also makes the preview useful: a reviewer sees a representative message without needing a production account, an active reset token, or a real store's report. Consider a fixture with an English reset message and a generated store report. Changing the report email's heading should leave both the attachment and the reset link untouched. That is the useful acceptance boundary. If the preview passes but the sending payload omits the report bytes, the customer still hasn't received a report.
Stored templates fit the reset flow because branding and copy can change outside application code while the application continues to send transactional messages. Create and preview variants once, then reuse them across environments. Localization still needs an explicit application decision: choose a supported locale, select matching copy, and fall back deliberately. Don't assume that a template service translates text or chooses the customer's language.
The trade-off is a separate template publication step. Someone still has to own it.
A small Node.js build before the sending adapter
The first implementation should establish the send schema before mapping any attachment fields. The following read-only example retrieves the public discovery schema for email sending. It doesn't send a reset message or upload a report. That boundary matters because a runnable schema lookup is more useful than a plausible-looking request with guessed attachment fields.
Save it as inspect-send.mts. Run node inspect-send.mts on a Node.js installation with TypeScript type stripping. Set INFRAI_BASE_URL to the provider's versioned API base and INFRAI_API_KEY to your key. The public discovery lookup itself requires no authentication; the example accepts the same key configuration the eventual sending adapter will use.
const baseUrl = process.env.INFRAI_BASE_URL;
const apiKey = process.env.INFRAI_API_KEY;
if (!baseUrl || !apiKey) {
throw new Error("Set INFRAI_BASE_URL and INFRAI_API_KEY");
}
const url = new URL(
baseUrl.replace(/\/$/, "") + "/discovery/email.send"
);
if (url.protocol !== "https:") {
throw new Error("Use the provider's HTTPS API base");
}
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch(url, {
method: "GET",
headers: { Authorization: `Bearer ${apiKey}` },
});
if (response.status === 429 && attempt < 3) {
const header = response.headers.get("Retry-After");
const seconds = header === null ? NaN : Number(header);
const retryAt = header === null ? NaN : Date.parse(header);
const requestedDelay = Number.isFinite(seconds)
? Math.max(0, seconds * 1000)
: Number.isFinite(retryAt)
? Math.max(0, retryAt - Date.now())
: 0;
const delay = Math.max(1000 * 2 ** attempt, requestedDelay);
await response.body?.cancel();
await new Promise<void>((resolve) => setTimeout(resolve, delay));
continue;
}
const body = await response.text();
if (!response.ok) {
throw new Error(`Schema lookup failed (${response.status}): ${body}`);
}
console.log(JSON.stringify(JSON.parse(body), null, 2));
break;
}
This GET operation doesn't create anything. Production send retries need the chosen capability's documented idempotency behavior and a stable identifier for the logical operation. The platform convention specifies a 24-hour default deduplication window; check the capability's idempotency declaration before relying on that convention for a write. An application record must cover retries beyond the provider's window.
Next, build two preview fixtures: one reset body with an inactive token and one report body with a generated attachment. Use a 15-minute expiration only as an illustrative application policy. Printing that window in HTML doesn't enforce it. Production logic must generate a secure one-time token, validate expiry, and consume the token when the password changes.
Check the attachment independently.
The smallest useful preview review checks the rendered reset link, expiration wording, selected locale, and fallback behavior. The report review checks the body and the generated artifact separately: recipient, report identity, filename, and bytes in the actual sending payload. A successful body preview proves none of those attachment properties. Avoid putting a real customer report or usable reset token in a fixture.
For localized copy, start with two explicitly selected variants and one declared fallback. Reuse the reviewed markup in stored templates, then map display values to the documented variable fields. The application owns language selection; the template owns presentation. This is deliberately a schema-inspection build, not a complete sending implementation.
Which provider removes work from the weekly release?
Compare Resend, Postmark, and SendGrid against the same reset and report fixtures. Their official documentation provides the starting point for evaluating transactional sending and template workflows.
| Option | Useful starting point | Work to budget for |
|---|---|---|
| Resend | Email API documentation and Node.js integration | Decide how much rendering stays in application code and where template preview approval lives. |
| Postmark | Transactional templates and template layouts | Map the display values into the template model and review layout changes against both messages. |
| SendGrid | Dynamic transactional templates | Map application data into the chosen template version and establish a version promotion process. |
These choices allocate work differently. Resend is worth evaluating when rendering should remain close to the Node.js application. Postmark is worth evaluating when shared transactional layouts dominate maintenance. SendGrid is worth evaluating when dynamic template versions match the review process. Each still needs the same attachment check and application-owned reset security. None removes the need to inspect the exact send schema.
Infrai offers one key and one bill across backend services and one REST API with no SDK required: a simple API for plain HTTP requests from any language or runtime. The shared credentials reduce separate dashboards and invoice reconciliation for a solo founder; the single API avoids adding a separate SDK dependency to the Node.js report worker. Its self-describing API adds a different integration advantage: public discovery requires no key and returns request JSON Schema, response schemas, and runnable examples in 10 languages. For the report workflow, that lets the developer inspect the sending contract before mapping generated attachment data, rather than guessing fields from a preview. The same REST interface spans 295 routes across 20 modules. For an email-only project, a dedicated provider may be the smaller commitment.
Choose by maintenance burden.
The limitation of any unified interface is that shared conventions don't decide your business rules. Keep recipient authorization, language selection, and report ownership in the application. Send reset messages immediately after creating the token, so account recovery doesn't depend on a later scheduled delivery decision.
What I would change at scale
At scale, the next change would be a durable record of each logical send, its locale, template revision, and report identity. A retry should refer to that same operation. Verify an ambiguous outcome before assuming another send is safe.
Keep the report artifact stable for that operation. Regenerating it during a delivery retry can change what the recipient receives even if the email body is identical. For a one-person business, that creates support work precisely where the integration was supposed to remove work. Recording the artifact identity is a more useful next step than adding another provider abstraction before there is a reason to switch.
Stored templates reduce duplicate presentation code, but a shared layout expands the effect of an edit. Preview both messages before publishing a revision.
Two messages. One review.
For the first weekly release, choose the provider whose documented template workflow removes the most routine integration work under those constraints. Revisit that choice when review volume or delivery operations become the actual bottleneck.
Top comments (0)