Skip to main content
By the end of this guide, a user can invite a teammate to their workspace, and the invitee gets a branded email with a one-click accept link that adds them to the team. This is a textbook SenderKit fit: nobody sends “Ada invited you to Acme” for you — it’s entirely your app’s domain — and the copy (workspace name, inviter, role) is all dynamic variables. You wire the send once; the wording stays editable in the dashboard.
You’ll need: a SenderKit account with an API key, a Next.js app, and a database (the examples use Postgres on Supabase or Neon). Use an sk_test_ key while building.
1

Author the invite template

Create an email template with the slug team-invite and these variables:
Template copy (in the dashboard editor)
2

Add an invites table

Each invite is a row with a unique, unguessable token and a status.
3

Configure the SenderKit client

lib/senderkit.ts
4

Create the invite and send it

A server action: mint a token, persist the invite, build the accept URL, and send.
app/actions/invite.ts
The token is the security boundary — make it long and random (here, 24 random bytes) and store only this single-use value. Never put the workspace ID or email directly in the accept URL where it could be guessed or tampered with.
5

Handle the accept link

When the invitee clicks through, validate the token, add them to the workspace, and mark the invite consumed.
app/invite/accept/route.ts
6

Verify it works

With your sk_test_ key, call inviteTeammate(...) from a form or a quick script and confirm the message in the SenderKit dashboard (test mode runs the full lifecycle without sending a real email). Copy the accept_url from the rendered message and hit it to confirm the invitee lands in the workspace and the row flips to accepted.Swap to an sk_live_ key to send real invites — no other change.

What’s next

Notify on a database change

Fire emails straight from Supabase row changes.

Welcome on signup

Greet users the moment they join.

Variables

Conditionals and loops for richer invite copy.

Sending

Idempotency keys and the async delivery model.