Which emails the starter sends, how to set them up in Loops, the variables each template receives, and what happens when email isn't configured.
Updated · 3 min read
The starter sends its transactional email through Loops, using templates you publish there. Email is optional: without the Loops settings the app runs, but those emails aren't sent and the sign-in page leaves out emailed links. Recipients are never added to a marketing audience.
The emails
| When it goes | Template variable | |
|---|---|---|
| Password reset | A user asks at /forgot-password | LOOPS_RESET_PASSWORD_TEMPLATE_ID |
| Email verification | Sign-up, a resend from the account page, or an email change | LOOPS_VERIFY_EMAIL_TEMPLATE_ID |
| Sign-in link | A user chooses "Email me a link instead" | LOOPS_MAGIC_LINK_TEMPLATE_ID (optional; unset, emailed links are off) |
| Organisation invitation | An owner or admin invites someone | LOOPS_INVITATION_TEMPLATE_ID |
| Affiliate notices | Application decided, commission earned, payout recorded, new application for admins | LOOPS_AFFILIATE_TEMPLATE_ID (optional) |
| Subscription confirmation | Someone signs up to your list (double opt-in) | LOOPS_CONFIRM_SUBSCRIPTION_TEMPLATE_ID |
| Download link | Someone requests a gated download | LOOPS_DOWNLOAD_TEMPLATE_ID |
| Enquiry notice | Someone sends the contact form | LOOPS_ENQUIRY_TEMPLATE_ID |
Every email also needs LOOPS_API_KEY. All of these are server variables. An empty value counts as unset.
Set up Loops
- In Loops, verify your sending domain. The sender name and address are set on each Loops template; the code has none.
- Publish a transactional template for each email you want, using the variables in the next section.
- Set
LOOPS_API_KEYand the template ids on the server: inapps/server/.envlocally, or onserverin Railway. - Restart or redeploy the server.
Start with the three account emails (reset, verification, invitation). Until they're set, people can't reset a password, and invitations need their link shared by hand.
Template variables
Each email sends these data variables to its template:
| Variable | Sent with | Value |
|---|---|---|
url | Every email | The action link: reset, verify, sign in, accept, confirm or download |
name | Every email | The recipient's name; for invitations, the inviter's name; empty for a sign-in link to a new address |
organizationName | Invitations | The organisation's name |
subject, body | Affiliate notices, enquiries | The notice's subject and text |
unsubscribeUrl | Subscription confirmation, download link | The one-click unsubscribe page |
title | Download link | The download's title |
replyTo | Enquiries | The visitor's address |
The sign-in link template needs url for its button and may greet with name. Tell the reader the link works once and expires in 5 minutes.
When email isn't configured
- At start-up the server logs a warning naming the missing settings for the reset, verification and invitation emails.
- A request that needs a missing email gets "Email delivery is not configured. Contact your administrator."
- If Loops refuses or can't be reached, the user sees "Email delivery failed. Please try again later." Loops' own response is never shown.
- Sign-up never fails because of email. A failed verification email is logged and the account is still created.
- Invitations are created without email; owners and admins copy the link from the organisation page.
- Affiliate notices are logged in development and skipped elsewhere.
Account emails are not printed to the console. To test reset and verification locally, configure Loops with test templates. Audience emails are the exception: in development, one whose template isn't set is logged with its link, so you can try signups and downloads without Loops. Admin → Audience warns while any of the three audience templates is missing.
Audience sync
Transactional email never enrols anyone in marketing. To copy confirmed subscribers into your Loops audience, set LOOPS_AUDIENCE_SYNC=true. Confirming adds the contact as subscribed, unsubscribing marks them unsubscribed, and deleting a subscriber in Admin → Audience removes them from Loops. A failed sync is logged and never undoes the change. See Analytics and the audience.
Using another provider
All email goes through one sender function on the server. To switch provider, replace that function's body and keep its errors, so nothing that calls it changes. Then replace the LOOPS_* variables with your provider's. Email is only ever sent from the server, which is the only place that holds the API key.
Something unclear or missing? Ask us and we'll answer, then fix the page.


