Email — Calendar Events
Calendar events email extension for Caffeine AI.
Overview
This skill adds support for organising events/meetings and sending iCalendar invitations by email. It provides CRUD operations for calendar events and email-based invitation delivery.
Backend
This component is for organising events/meetings and sending invitations by email
- Internally it builds and attaches an iCalendar file to each attendees's email
- This component does not yet support receiving RSVPs from attendees
To add/update/cancel/delete/get/list calendar events
- Use the prefabricated module
mo:caffeineai-email-calendar-events/calendarEvents.mowhich cannot be modified.
For sending calendar event invitations to attendees by email
- Use the
sendCalendarEventfunction of the same module. It sends one copy per attendee through the mail gateway when the canister has the gateway key (INTEGRATIONS_GATEWAY_URL/INTEGRATIONS_GATEWAY_API_KEY, injected by the platform where the gateway is enabled) and through the transport canister otherwise; the app code is the same either way.caffeineai-emailis a dependency of this package, and the app does not call it for calendar mail. fromUsernameis the local part of the sender only, such aseventsorno-reply. The invitation comes from<fromUsername>@<app domain>, and the app domain is the project's own, resolved by the mail gateway. Never pass a full address and never read or guess the domain in the app.- The organizer is that same mailbox.
CalendarEvent.organizercarries only a display name,{ name = ?"Community Team" }, shown as the ICSORGANIZERand the first guest, so calendars see the invitation arrive from its organizer. Attendees are the only mailboxes with addresses; the organizer receives a copy only when also listed as an attendee. Do not model the organizer as a user with an email address. - It returns
#okonce the invitation was accepted for every attendee, otherwise#err(error)with the error text.
Example usage for an app which can add/update/cancel/delete/get/list calendar events and send invitations to them by email
The migration chain head:
Upgrading from the previous version
An app built with caffeineai-email-calendar-events 0.2.x re-pins with mops add [email protected] and mops add [email protected]. CalendarEvent.organizer is now an Organizer ({ name : ?Text }) instead of a Mailbox: the organizer address is the sender's, <fromUsername>@<app domain>, built by the mail gateway, so the app no longer supplies one. add and update take the new type, and an app that stored events adds a migration step that maps each stored organizer to { name = old.organizer.name }.
An app built with caffeineai-email-calendar-events 0.1.x re-pins with mops add [email protected] and mops add [email protected]. sendCalendarEvent keeps its signature but moves from EmailClient to this module (CalendarEvents.sendCalendarEvent), and the event types (CalendarEvent, Attendee, Mailbox, CalendarEventMethod, CalendarEventRole) are this module's; an app that imported them from EmailClient switches the import and drops EmailClient when nothing else uses it. Invitations are now composed and sent by the mail gateway. update, addAttendees, removeAttendees and cancel now return the stored record (with the bumped sequence) instead of the previous one, so an app that sends the returned record after a change sends the right sequence.



