extension-email-raw
This skill enables sending emails with multiple recipients in the To, Cc, and Bcc fields. It streamlines the process of dispatching structured emails to various recipient types, such as meeting reminders, significantly enhancing communication efficiency and accuracy while minimizing errors that could arise from manual handling, ensuring precise information delivery.
npx skills add https://github.com/caffeinelabs/skills --skill extension-email-rawBefore / After Comparison
1 组Users or developers had to manually manage and input multiple To, Cc, and Bcc addresses, which was error-prone and time-consuming, especially when distinguishing between different recipient roles. This increased the workload for pre-send checks and confirmations.
This skill automates the multi-recipient email sending process, handling To, Cc, and Bcc addresses through structured input in one go. It significantly reduces manual operation time and lowers communication risks due to address input errors, ensuring accurate email delivery.
Email — Raw Multi-Recipient
Raw multi-recipient email extension for Caffeine AI.
Overview
This skill adds support for sending emails with multiple to, cc, and bcc recipients. Not suitable for bulk service emails (recipients see each other).
Backend
This extension is for sending an email with support for multiple to, cc and bcc addresses.
- This should NOT be used for sending service emails to multiple users because each recipient will see all the other recipients listed which would typically be a breach of user privacy.
For sending an email
- This extension depends on the extension-email for sending emails.
- Use the sendRawEmail function.
- It returns a SendResult which is #ok if the email is sent successfully otherwise #err(error) with the error text.
- There can be a maximum of 50 recipients in total
- Each recipient receives the same email
module {
public type SendResult = {
#ok;
#err : Text;
};
public func sendRawEmail(
fromUsername : Text,
to : [Text],
cc : [Text],
bcc : [Text],
subject : Text,
htmlBody : Text,
) : async SendResult;
};
Example usage for sending an email reminder to meeting attendees.
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);
};
};
};
};
User Reviews (0)
Write a Review
No reviews yet
Statistics
User Rating
Rate this Skill