extension-email — Claude Code skill: what it does, how to install
Enables agents to send transactional and service emails from Motoko backend canisters. Useful for notifications and order receipts.
npx skills add caffeinelabs/skills --skill extension-email -a claude-codeWhat extension-email does
This skill guides the agent in using the prefabricated mo:caffeineai-email/emailClient.mo module within Motoko canisters. It handles transactional messages like order confirmations and one-off notifications. It is strictly not intended for marketing campaigns or verification flows.
The component relies on the sendServiceEmail function, sending an individual email to each recipient. Results arrive as a SendResult type with either #ok or #err. Failed dispatches never throw exceptions, returning gateway or transport errors as #err(Text).
Operation requires a Caffeine AI subscription on plus or pro tiers and the caffeineai-email package pinned to ~0.4.0. Starting with this version, dispatches route through a mail gateway configured via INTEGRATIONS_GATEWAY_URL and INTEGRATIONS_GATEWAY_API_KEY. Missing deploy credentials will cause the call to fail immediately with #err.
What it helps with
- send order confirmation emails from a Motoko backend
- deliver transactional notifications to individual recipients
- handle email dispatch errors via SendResult without throwing exceptions
Example prompts for the agent
- Write a function to send order confirmation emails using
sendServiceEmailfrommo:caffeineai-email/emailClient. - Handle the
SendResultreturn type for service emails in the Motoko backend canister.
How to install extension-email
1Skills CLI (Vercel)
npx skills add caffeinelabs/skills --skill extension-email -a claude-code2Manually: put the files in place
~/.claude/skills/extension-email/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/extension-email/
1Skills CLI (Vercel)
npx skills add caffeinelabs/skills --skill extension-email -a codex2Manually: put the files in place
.agents/skills/extension-email/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add caffeinelabs/skills --skill extension-email -a cursor2Manually: put the files in place
.cursor/skills/extension-email/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install caffeinelabs/skills extension-email2Manually: put the files in place
.github/skills/extension-email/SKILL.md1Skills CLI (Vercel)
npx skills add caffeinelabs/skills --skill extension-email -a gemini-cli2Platform CLI
gemini skills install https://github.com/caffeinelabs/skills --path skills/extension-emailManually: put the files in place
.devin/skills/extension-email/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add caffeinelabs/skills --skill extension-email -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about extension-email
How to install extension-email in Claude Code?
Run npx skills add caffeinelabs/skills --skill extension-email -a claude-code in your terminal.
Can I use extension-email for newsletter campaigns?
No, this extension is limited to service and transactional emails. Marketing and verification emails require separate components.
What dependencies are required for extension-email?
You need a Caffeine AI plus or pro subscription, caffeineai-email version ~0.4.0 via mops, and platform gateway credentials set on deployment.
Source text
SKILL.md · Apache-2.0
---
name: extension-email
description: Support for sending service/transactional emails. Don't use this for sending marketing emails or verification emails.
version: 0.4.1
compatibility:
mops:
caffeineai-email: "~0.4.0"
caffeineai-subscription: [plus, pro]
---
# Email — Service/Transactional
Service/transactional email extension for [Caffeine AI](https://caffeine.ai?utm_source=caffeine-skill&utm_medium=referral).
## Overview
This skill adds support for sending service and transactional emails from the backend canister. Use `sendServiceEmail` for order confirmations, notifications, and similar one-off emails.
# Backend
This component is for sending service/transactional emails.
There is the prefabricated module `mo:caffeineai-email/emailClient.mo` which cannot be modified.
- Use the sendServiceEmail function.
- Each recipient is sent an individual email
- It returns a SendResult which is #ok if the email is sent successfully otherwise #err(error) with the error text.
- A failed send never throws. Every failure, a gateway error included, comes back as `#err`.
```mo:caffeineai-email/emailClient.mo
module {
public type SendResult = {
#ok;
#err : Text;
};
public func sendServiceEmail(
fromUsername : Text,
recipients : [Text],
subject : Text,
htmlBody : Text,
) : async SendResult;
};
```
Usage for `sendServiceEmail`:
```motoko filepath=src/backend/main.mo
import Runtime "mo:core/Runtime";
import EmailClient "mo:caffeineai-email/emailClient";
actor {
public func sendOrderConfirmationEmail(recipientEmailAddress : Text, username : Text, orderReference : Text) : async () {
let result = await EmailClient.sendServiceEmail(
"no-reply",
[recipientEmailAddress],
"Order " # orderReference # " confirmed",
"Hello " # username # ",\nYour order " # orderReference # " has been confirmed. Your items will ship tomorrow.",
);
switch (result) {
case (#ok) {};
case (#err(error)) {
Runtime.trap("Failed to send order confirmation email: " # error);
};
};
};
};
```
## Upgrading from the previous version
An app built with `caffeineai-email` 0.3.x re-pins with `mops add [email protected]`. `sendServiceEmail` and `sendRawEmail` keep their signatures. Every send now goes through the mail gateway with the settings the platform injects on every deploy (`INTEGRATIONS_GATEWAY_URL` / `INTEGRATIONS_GATEWAY_API_KEY`); the transport canister and `INTEGRATIONS_CANISTER_ID` are no longer used, and a send without those settings returns `#err` instead of falling back. Apps that use verification, marketing or calendar email follow the upgrade sections of those skills.
An app built with `caffeineai-email` 0.2.x re-pins with `mops add [email protected]`. `sendServiceEmail` and `sendRawEmail` keep their signatures; every send now carries an idempotency key, so a retried outcall is sent and charged once. Apps that use verification or marketing email follow the upgrade sections of those skills.
© caffeinelabs · Apache-2.0 · caffeinelabs/skills