Terminal
Terminal/Skill
Send an email with multiple to, cc and bcc addresses.
By Caffeine
Works with
npx skills add caffeinelabs/skills --skill extension-email-rawRaw multi-recipient email extension for Caffeine AI.
This skill adds support for sending emails with multiple to, cc, and bcc recipients. Not suitable for bulk service emails (recipients see each other).
to, cc and bcc addresses.module {
public type SendResult = {
#ok;
#err : Text;
};
public func sendRawEmail(
fromUsername : Text,
to : [Text],
cc : [Text],
bcc : [Text],
subject : Text,
htmlBody : Text,
) : async SendResult;
};
import Runtime "mo:core/Runtime";
import EmailClient "mo:caffeineai-email/emailClient";
actor {
public func sendMeetingReminder(
meetingSubject : Text,
meetingTime : Text,
confirmedAttendeeEmails : [Text],
tentativeAttendeeEmails : [Text],
) : async () {
let result = await EmailClient.sendRawEmail(
"no-reply",
confirmedAttendeeEmails,
tentativeAttendeeEmails,
[],
meetingSubject,
"Reminder the meeting will start at " # meetingTime,
);
switch (result) {
case (#ok) {};
case (#err(error)) {
Runtime.trap("Failed to send meeting reminder email: " # error);
};
};
};
};
An app built with caffeineai-email 0.2.x re-pins with mops add caffeineai-email@0.3.0. sendRawEmail keeps 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.