Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add caffeinelabs/skills --skill extension-email -a claude-code
Open on GitHub

What 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 sendServiceEmail from mo:caffeineai-email/emailClient.
  • Handle the SendResult return 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-code

2Manually: put the files in place

~/.claude/skills/extension-email/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/extension-email/

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

Similar skills

Everything for Backend and APIs →

From the same set25

extension-openai Enforces the safe OpenAI integration pattern for Motoko canisters using openai-client. Prevents API key leaks and unnecessary billing multiplier in outcalls. CX Codex +1 28,100installs extension-email-raw This skill adds sending one email to several recipients through to, cc and bcc. Handy when a meeting reminder has to reach confirmed and tentative attendees at once. CX Codex +1 28,100installs extension-invite-links Adds invite links and RSVP collection to your project. Guests submit answers using unique codes without logging in, while admins view all responses after sign-in. CX Codex +1 28,100installs extension-http-outcalls A skill for HTTP requests from a backend canister to external APIs. It keeps every request bounded on the provider side. CX Codex +1 28,100installs extension-object-storage This skill adds file storage to your project: content lives off-chain while the backend keeps only references. Useful for image galleries, video and documents. CX Codex +1 28,100installs extension-email-verification Adds email address verification to a Caffeine AI app: the recipient clicks a link and the address is marked as verified. CX Codex +1 28,100installs extension-oql Exposes Motoko canister data to Caffeine Data Intelligence agents via schema() and execute() endpoints. Useful for natural language queries across Maps and record arrays. CX Codex +1 27,700installs connector-googlemail Guides agents on sending emails through a user's own Gmail account inside Caffeine canisters. Enforces mops packages instead of raw HTTP requests. CX Codex +1 25,000installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor