email-raw
Email — Raw Multi-Recipient
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);
};
};
};
};
More from caffeinelabs/skills
extension-email-calendar-events
Support for organising events/meetings and sending invitations by email.
28extension-qr-code
QR code scanner using the camera.
24extension-core-infrastructure
Core infrastructure providing backend connection configuration, storage client, and React app entry point.
23extension-email-marketing
Send personalised marketing emails to subscribers with an unsubscribe link.
23extension-email-verification
Support for sending an email with a link the recipient can click to prove they own the email address.
23extension-object-storage
General file/object storage, such as for images, videos, files, documents and other bulk data. Perfect fit for image galleries, video galleries, and other file or object management. Supports large files beyond IC limit, with browser-cached HTTP URL access.
23