Loops
Send transactional and marketing email with Loops. Use this skill when the project needs to integrate Loops for event-driven email, automated sequences, transactional sends, contact management, or product-led email marketing. Covers the Loops API, events, transactional sends, contacts, and audience management.
You are an email operations specialist who integrates Loops into projects. Loops
is a modern email platform built for SaaS companies, combining transactional email
and product-led marketing automation with an event-driven API.
## Key Points
- A unique ID (`tmpl_xxx`)
- Template variables (referenced as `{{ variableName }}` in the editor)
- Subject line (can include variables)
- `tmpl_password_reset` — Password reset with `resetUrl`, `expiresIn`
- `tmpl_verify_email` — Email verification with `verifyUrl`
- `tmpl_welcome` — Welcome email with `name`, `planName`
- `tmpl_receipt` — Payment receipt with `amount`, `invoiceId`, `date`
- `tmpl_api_key_created` — API key notification with `keyName`, `keyPreview`
- Use events for all automated/lifecycle email — keep send logic in Loops
- Use transactional sends only for immediate, user-triggered email (password reset, OTP)
- Store user attributes as contact properties for segmentation
- Design onboarding sequences in the visual builder — iterate without deploys
## Quick Example
```bash
npm install loops
```
```typescript
import { LoopsClient } from 'loops';
const loops = new LoopsClient(process.env.LOOPS_API_KEY);
```skilldb get email-services-skills/loopsFull skill: 177 linesLoops Email Integration
You are an email operations specialist who integrates Loops into projects. Loops is a modern email platform built for SaaS companies, combining transactional email and product-led marketing automation with an event-driven API.
Core Philosophy
Events are the API
Loops is built around events, not send calls. Your application fires events (user signed up, payment completed, feature activated), and Loops handles the email logic. This keeps email concerns out of your application code.
Product-led, not sales-led
Loops is designed for product-led growth workflows: onboarding sequences, feature announcements, usage-based triggers, and lifecycle email. The mental model is "what did the user do" not "what email should I send."
Visual workflow builder
Email sequences and automation logic live in Loops' visual builder, not code. Engineers integrate events, product managers design the email flows.
Setup
Install
npm install loops
Initialize
import { LoopsClient } from 'loops';
const loops = new LoopsClient(process.env.LOOPS_API_KEY);
Key Techniques
Send event (trigger automations)
Events trigger automation workflows configured in the Loops dashboard.
await loops.sendEvent({
email: 'user@example.com',
eventName: 'user_signup',
eventProperties: {
name: 'Alice',
plan: 'free',
source: 'organic',
},
});
Transactional send
Direct sends for immediate transactional email with a Loops transactional template.
await loops.sendTransactionalEmail({
transactionalId: 'tmpl_password_reset',
email: 'user@example.com',
dataVariables: {
resetUrl: 'https://...',
expiresIn: '1 hour',
},
});
Contact management
// Create contact
await loops.createContact(
'user@example.com',
{
firstName: 'Alice',
plan: 'pro',
signupDate: '2025-01-15',
}
);
// Update contact
await loops.updateContact(
'user@example.com',
{ plan: 'enterprise' }
);
// Delete contact
await loops.deleteContact('user@example.com');
Mailing lists
// Add contact to mailing list
await loops.addContactToMailingList({
email: 'user@example.com',
mailingListId: 'list_newsletter',
});
Event-Driven Workflow Design
| Application Event | Loops Event | Automation |
|---|---|---|
| Sign up | user_signup | Welcome → Day 3: Setup tips → Day 7: Feature guide |
| Trial start | trial_started | Day 1: Getting started → Day 10: Advanced features → Day 13: Trial ending |
| Payment | payment_completed | Receipt → Feature unlock notification |
| Feature first use | feature_activated | Congratulations + advanced tips |
| Churn risk | inactive_7_days | Re-engagement email |
| Upgrade | plan_upgraded | Welcome to new plan + feature overview |
Configure these automations in the Loops dashboard. Code only fires events:
// In your payment webhook handler
async function handlePaymentSuccess(user, invoice) {
await loops.sendEvent({
email: user.email,
eventName: 'payment_completed',
eventProperties: {
amount: invoice.amount,
plan: invoice.plan,
invoiceId: invoice.id,
},
});
}
// In your auth handler
async function handleSignup(user) {
await loops.createContact(user.email, {
firstName: user.name,
plan: 'free',
});
await loops.sendEvent({
email: user.email,
eventName: 'user_signup',
});
}
Transactional Templates
Create transactional templates in the Loops dashboard. Each template has:
- A unique ID (
tmpl_xxx) - Template variables (referenced as
{{ variableName }}in the editor) - Subject line (can include variables)
Common templates to create:
tmpl_password_reset— Password reset withresetUrl,expiresIntmpl_verify_email— Email verification withverifyUrltmpl_welcome— Welcome email withname,planNametmpl_receipt— Payment receipt withamount,invoiceId,datetmpl_api_key_created— API key notification withkeyName,keyPreview
Best Practices
- Use events for all automated/lifecycle email — keep send logic in Loops
- Use transactional sends only for immediate, user-triggered email (password reset, OTP)
- Store user attributes as contact properties for segmentation
- Design onboarding sequences in the visual builder — iterate without deploys
- Use event properties for template personalization
- Test automations with test contacts before enabling for all users
Anti-Patterns
- Using transactional sends for everything instead of events + automations
- Not creating contacts before sending events — events to unknown contacts are dropped
- Building email sequence logic in application code
- Not passing relevant data in event properties — limits template personalization
- Using Loops for high-volume bulk sends — it's designed for product-led email
Install this skill directly: skilldb add email-services-skills
Related Skills
Mailchimp Transactional
Send transactional email with Mailchimp Transactional (formerly Mandrill). Use this skill when the project needs to integrate Mandrill/Mailchimp Transactional for reliable transactional email, template-based sending, metadata tracking, subaccounts, webhook processing, or inbound email routing. Covers the Mandrill API, templates, subaccounts, metadata, and webhooks.
Mailgun
Send transactional and marketing email with Mailgun. Use this skill when the project needs to integrate Mailgun for email sending via API or SMTP, mailing lists, email validation, template management, route-based inbound processing, event tracking, or deliverability optimization. Covers the Mailgun REST API, templates, mailing lists, routes, webhooks, and email validation.
Mailjet
Send transactional and marketing email with Mailjet. Use this skill when the project needs to integrate Mailjet for email delivery via REST API or SMTP, template management with MJML, contact list management, segmentation, real-time event tracking, send-time optimization, and A/B testing. Covers the Send API v3.1, template language, contact management, and event webhooks.
Mailtrap
Send and test email with Mailtrap. Use this skill when the project needs to integrate Mailtrap for email testing in development, transactional email sending in production, email previewing, HTML validation, spam score checking, or sandbox email capture. Covers both Mailtrap Email Testing (sandbox) and Mailtrap Email Sending (production transactional API).
Nodemailer
Send email with Nodemailer in Node.js. Use this skill when the project needs to send email via SMTP, integrate with any SMTP relay (Gmail, Outlook, SES, custom), send attachments, embed images, use HTML templates, or build custom email infrastructure without a managed email API. Covers SMTP transports, pooled connections, attachments, HTML templating, OAuth2, and common relay configurations.
Plunk
Send transactional and marketing email with Plunk. Use this skill when the project needs to integrate Plunk for open-source email, transactional sends, automated sequences, contact management, or self-hosted email infrastructure. Covers the Plunk API, events-based email triggers, automations, contacts, and self-hosting.