loops
БесплатноБез исполняемых скриптовНе проверенSend marketing and transactional emails with Loops. Use when a user asks to set up email marketing for a SaaS, create drip campaigns, send product update…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Loops
Overview
Loops is email for SaaS products: transactional emails, event-triggered automations (called workflows), one-off campaigns and a contact audience, all behind one REST API (https://app.loops.so/api/v1, Bearer authentication with an API key from Settings, API). The official JavaScript SDK is the loops package (npm install loops, Node 18+). The plain fetch calls below and the SDK methods map one to one.
Instructions
Step 1: Client and key check
// lib/loops.ts
import { LoopsClient, APIError, RateLimitExceededError } from 'loops'
export const loops = new LoopsClient(process.env.LOOPS_API_KEY!)
// loops.testApiKey() returns { success: true, teamName } for a valid key
Without the SDK, call GET /v1/api-key with Authorization: Bearer $LOOPS_API_KEY; a missing or wrong key gives 401.
Step 2: Transactional email
Create the email in the Loops editor, add its data variables, publish it, and copy its ID. Publishing is required: sending an unpublished email returns 400.
import { randomUUID } from 'node:crypto'
import { loops } from './lib/loops'
await loops.sendTransactionalEmail({
transactionalId: 'clfq6dinn000yl70fgwwyp82l', // ID shown in the Loops dashboard
email: '[email protected]',
dataVariables: { firstName: 'Maria', planName: 'Pro' },
headers: { 'Idempotency-Key': randomUUID() }, // a retry within 24 h returns 409 instead of a second email
})
Raw equivalent: POST /v1/transactional with JSON { email, transactionalId, dataVariables, addToAudience? }. Every required data variable of the template must be present, otherwise the API answers 400 naming the missing field. Attachments only work after Loops support enables them for the account.
Step 3: Events that trigger workflows
await loops.sendEvent({
email: '[email protected]', // or userId; at least one is required
eventName: 'plan_upgraded',
eventProperties: { plan: 'pro', mrr: 49 }, // usable inside the emails this event sends
contactProperties: { plan: 'pro' }, // optional: updates the contact at the same time
})
Raw equivalent: POST /v1/events/send. A workflow in the Loops dashboard with the "event received" trigger sends the emails.
Step 4: Contacts
await loops.updateContact({ // PUT /v1/contacts/update; creates the contact if it does not exist
email: '[email protected]',
properties: { // the SDK nests fields under `properties`; the raw REST body is flat
firstName: 'Maria',
userGroup: 'pro-users',
plan: 'pro', // custom property: create it first in Settings or POST /v1/contacts/properties
},
})
Other calls: createContact (POST /v1/contacts/create, fails if the contact exists), findContact (GET /v1/contacts/find?email=), deleteContact (POST /v1/contacts/delete), createContactProperty. Built-in fields (flat in the REST body, inside properties in the SDK) are email, firstName, lastName, source, subscribed, userGroup, userId and mailingLists ({ listId: true|false }).
Step 5: Errors and rate limits
try {
await loops.sendEvent({ email: '[email protected]', eventName: 'signup' })
} catch (error) {
if (error instanceof RateLimitExceededError) {
// error.limit requests per second were exceeded: wait, then retry
} else if (error instanceof APIError) {
console.error(error.statusCode, error.json) // e.g. 400 { success: false, message: '...' }
} else {
throw error
}
}
Examples
Example 1: Welcome email after signup
User prompt: "When someone signs up, send them our welcome email from Loops and add them to the audience."
The agent will:
- Ask for the transactional email ID of the published "Welcome" template and the names of its data variables
- Add
sendTransactionalEmail({ transactionalId, email, addToAudience: true, dataVariables: { firstName } })to the signup handler, with anIdempotency-Keybuilt from the user ID so retries do not send twice - Wrap the call in the
APIErrorhandling from Step 5 so a Loops outage does not fail the signup
Result: the API returns { "success": true } and the email is sent; the address is added to the audience.
Example 2: Upgrade nurture sequence
User prompt: "After a customer upgrades to Pro, start a 3-email onboarding sequence."
The agent will:
- Tell the user to build a workflow in the dashboard with the trigger event
plan_upgradedand three timed emails (the sequence itself is built in the Loops UI, not in code) - Call
sendEventwitheventName: 'plan_upgraded'andeventProperties: { plan: 'pro' }from the billing webhook handler - Check the workflow's activity in the dashboard to see the contact enter it
Result: the contact enters the workflow and receives the first email according to its delay.
Guidelines
- Free pl
Установить loops в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл loops?
Send marketing and transactional emails with Loops. Use when a user asks to set up email marketing for a SaaS, create drip campaigns, send product update emails, or use a modern alternative to Mailchimp for startups.
Как установить скилл loops?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл loops запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic