Install
openclaw skills install skills-sh:caffeinelabs/skills/extension-emailEmail — Service/Transactional Service/transactional email extension for Caffeine AI. ## 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…
openclaw skills install skills-sh:caffeinelabs/skills/extension-emailService/transactional email extension for Caffeine AI.
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.
This component is for sending service/transactional emails.
There is the prefabricated module mo:caffeineai-email/emailClient.mo which cannot be modified.
#err.module {
public type SendResult = {
#ok;
#err : Text;
};
public func sendServiceEmail(
fromUsername : Text,
recipients : [Text],
subject : Text,
htmlBody : Text,
) : async SendResult;
};
Usage for sendServiceEmail:
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);
};
};
};
};
An app built with caffeineai-email 0.3.x re-pins with mops add caffeineai-email@0.4.0. 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 caffeineai-email@0.3.0. 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.
d03174cc42ab