agentleFS
param087param087/saas-starter-skills/skills/transactional-email/SKILL.md

transactional-email

Skill2 starsChanged 6 months agoMITView on GitHub

Use when sending product email — wire up Resend (or Postmark/SES) with typed React Email templates, send from background jobs not the request path, and cover deliverability basics like SPF/DKIM and unsubscribe.

  • Reads credentials

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Call sendInvite from a job/queue (see background-jobs), and the action just enqueues it.

    line 54

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Transactional Email

Overview

SaaS apps send email constantly: verification, invites, receipts, password resets, alerts. Use a provider built for it (Resend, Postmark, or SES) with React Email for typed, previewable templates. Treat sending as a side effect: trigger it from a background job, not inline in the request, so a slow mail API never blocks the user or fails their action.

When to use

  • Sending verification, invite, receipt, reset, or notification emails.
  • Building reusable, branded email templates.
  • Email sends are slowing requests or failing them.

Template + send

// src/server/email/templates/Invite.tsx
import { Button, Html, Text } from "@react-email/components";

export function InviteEmail({ org, url }: { org: string; url: string }) {
  return (
    <Html>
      <Text>You've been invited to join {org}.</Text>
      <Button href={url}>Accept invite</Button>
    </Html>
  );
}
// src/server/email/send.ts
import "server-only";
import { Resend } from "resend";
import { env } from "@/env";
import { InviteEmail } from "./templates/Invite";

const resend = new Resend(env.RESEND_API_KEY);

export async function sendInvite(to: string, org: string, url: string) {
  const { error } = await resend.emails.send({
    from: "Acme <noreply@acme.com>",
    to,
    subject: `Join ${org} on Acme`,
    react: InviteEmail({ org, url }),
  });
  if (error) throw new Error(`Email failed: ${error.message}`);
}

Call sendInvite from a job/queue (see background-jobs), and the action just enqueues it.

Deliverability essentials

  • Verify your domain and set SPF + DKIM + DMARC records — without them you land in spam.
  • Send from a real domain (noreply@yourapp.com), not a free inbox.
  • Include unsubscribe for anything non-essential; keep transactional and marketing streams separate.
  • Idempotency keys on critical sends (receipts) so retries don't double-send.

Pitfalls

  • Sending inline in the request — a 3s mail API call becomes a 3s user wait, and a mail outage fails signups. Enqueue it.
  • Skipping DKIM/SPF — great templates still hit spam without authenticated domains.
  • Hard-coded HTML strings — unmaintainable; use React Email components and preview them.
  • Leaking data across tenants — render with explicit, validated recipient + org; never reuse a cached template with stale props.
  • No failure handling — log and retry via the job system; surface nothing scary to the user.

Hand-off

Reliable, typed email behind a service. background-jobs runs the actual send off the request path; observability-and-errors tracks failures.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.