Email for professionals and teams
update README
Hieu Nguyen (Jack)2eaadb747ce2
diff --git a/README.md b/README.mdindex 72ded99..c12c7fe 100644--- a/README.md+++ b/README.md@@ -2,7 +2,7 @@# Mailflare-Mailflare is a self-hosted email inbox for custom domains, built on Cloudflare. Receive and send mail with Cloudflare Email Routing and Email Sending, **Resend**, or **Amazon SES**, chosen per domain.+Mailflare is a self-hosted email inbox for custom domains, built on Cloudflare. Supports **Resend**, or **Amazon SES**[](https://deploy.workers.cloudflare.com/?url=https://github.com/hieunc229/mailflare)@@ -26,13 +26,15 @@ Want to support the mailflare? <a target="_blank" href="https://store.paymug.co/- **Domain setup**: Connect Cloudflare-managed domains and, for each one, choose what receives and what sends its mail: Cloudflare, Resend, or Amazon SES. Mailflare creates the DNS and the provider resources from the dashboard.- **Mailboxes**: Create personal and shared mailboxes with delegated access.- **Email**: Send and receive email with attachments, rich formatting, signatures, and automatic replies.+- **Calendar**: Keep a personal calendar with week and day views, drag-to-move and resize, repeating events, time zones, colors, and attendees. Attendees get an email invitation with a calendar file when you choose a sending mailbox.+- **Booking pages**: Share a public link (`/book/<username>/<event>`) where anyone can pick a free time, such as a 15 or 30 minute meeting. Mailflare checks your calendar (including repeating events), hides busy times, and adds the booking to your calendar. Team plans can book with several hosts at once and require every host to be free.- **Inbox organization**: Organize mail with search, custom folders, stars, snoozing, archive, spam, and trash.- **Routing rules**: Create routing rules to store, forward, reject, or categorize incoming messages.- **Notifications**: Get real-time inbox updates and new-message notifications.- **Mail and contacts**: Import and export mail, manage contacts, and block unwanted senders.- **Administration**: Manage accounts, permissions, API keys, webhooks, audit logs, and database backups.-- **Email AI Assistant**: Use an AI assistant to search mail, work with threads, and prepare drafts for a selected mailbox.-- **MCP access**: Connect external AI clients through MCP with mailbox or admin permissions chosen for each key.+- **Email AI Assistant**: Use an AI assistant to search mail, work with threads, and prepare drafts for a selected mailbox, and to look up, create, and change events on your calendar.+- **MCP access**: Connect external AI clients through MCP with mailbox, calendar, or admin permissions chosen for each key.## How it works@@ -40,9 +42,17 @@ Mailflare runs in your Cloudflare account. By default Email Routing delivers inc## How much does it cost?-You can setup Mailflare and receive email for free+**You can set up Mailflare, receive email and send email for free.** Receiving through Cloudflare Email Routing costs nothing, and for sending you can use the free allowance of **Resend** or **Amazon SES** instead of Cloudflare's email sending, which needs a paid Worker plan:-A [Paid Worker](https://developers.cloudflare.com/workers/platform/pricing/) plan ($5/month) is required to send email with Cloudflare (and it's recommend to have a smooth experience). Sending through Resend or Amazon SES is billed by those services instead.+| Send with | Free allowance | After that |+| --- | --- | --- |+| **Resend** | 3,000 emails a month (up to 100 a day) and 3 domains | From $20/month for 50,000 emails |+| **Amazon SES** | $200 of AWS credits for new accounts (about 2 million emails at SES prices; the free plan lasts 6 months and credits expire after 12) | $0.10 per 1,000 emails |+| **Cloudflare Email Sending** | None | Needs a [Paid Worker](https://developers.cloudflare.com/workers/platform/pricing/) plan ($5/month) |++Receiving is free with Cloudflare Email Routing, included in every Resend plan, and $0.10 per 1,000 messages with Amazon SES (plus the small S3 and SNS charges for the mail it stores and announces).++New SES accounts start in a sandbox that only delivers to verified addresses until you request production access in the AWS console. Pick the provider per domain, and switch whenever you like (see [Sending and receiving providers](docs/providers.md)). Free allowances and prices are set by those providers and change, so check [Resend](https://resend.com/pricing), [Amazon SES](https://aws.amazon.com/ses/pricing/) and [Cloudflare](https://developers.cloudflare.com/workers/platform/pricing/) before you rely on them.## Deploy@@ -114,7 +124,7 @@ The Cloudflare app uses vinext and the Cloudflare Vite plugin, including local D- [Deployment and configuration](docs/deployment.md)- [Sending and receiving providers (Cloudflare, Resend, Amazon SES)](docs/providers.md)-- [API and integrations](docs/api.md)+- [API and integrations](docs/api.md), including the [calendar and booking APIs](docs/api.md#calendar-and-booking)- [Email assistant and MCP](docs/email-assistant-and-mcp.md)- [Troubleshooting](docs/troubleshooting.md)diff --git a/docs/api.md b/docs/api.mdindex f3daf82..2d0d0ed 100644--- a/docs/api.md+++ b/docs/api.md@@ -49,6 +49,40 @@ Resend and Amazon SES deliver mail by calling the app, so these routes are publi| `POST /api/inbound/ses?token=…` | The secret token in the subscription URL, the SNS topic ARN, and reading the message from the account's own S3 bucket || `POST /api/inbound` | The HMAC from the Cloudflare relay Worker, used by self-hosted installs ([self-hosting](self-hosting.md)) |+## Calendar and booking++### Calendar++Each user has a personal calendar at **Calendar** in the dashboard. Events have a title, description, location, attendees, color, time zone and an optional repeat (`daily`, `weekly`, `monthly` or `weekdays`, with an end date and skipped occurrences). Changing or deleting a repeating event affects the whole series unless you choose a starting occurrence.++When you add attendees and choose a sending mailbox, Mailflare emails each attendee an invitation with a calendar (`.ics`) file from that mailbox, and sends updates and cancellations the same way. Events created through MCP tools or the assistant record attendees but do not send invitations.++| Mailflare route | Purpose |+| --- | --- |+| `GET /api/calendar/events?start=&end=` | List events in an ISO 8601 range (default: the next 31 days). Repeating events are returned once, with their rule |+| `POST /api/calendar/events` | Create an event (`{ title, startsAt, endsAt, description?, location?, attendees?, color?, repeat?, repeatDays?, timeZone?, mailboxId?, from? }`) |+| `PATCH /api/calendar/events/[eventId]` | Update an event or series. For a repeating event, pass an occurrence ID or `effectiveFrom` to change it from that occurrence onward |+| `DELETE /api/calendar/events/[eventId]` | Delete an event, or a series from an occurrence onward |++These routes accept the dashboard session or an API key (`Authorization: Bearer <key>`) with the **Read calendar** (`calendar:read`) or **Manage calendar** (`calendar:write`) scope, which you choose when creating the key in **Settings → API keys**. A key can only send invitations if it also has the `send` scope for the chosen mailbox. MCP and the assistant use separate calendar tools, described in [Email assistant and MCP](email-assistant-and-mcp.md).++### Booking pages++Open **Booking** to create booking events: a name, link (slug), duration, location, weekdays, one or more daily time ranges, a time zone and an on/off switch. Two disabled templates (15 and 30 minute meetings) are offered to start from. Each user gets a booking username, derived from their email and unique across the instance; an administrator can change it. Booking events are served at `/book/<username>` (the list) and `/book/<username>/<event>` (one event), with no login.++A guest picks a slot, enters a name, email, optional extra guest emails and notes, and the booking is added to the host's calendar with the guest as attendee. Slots come from the host's availability: every 15 minutes inside the allowed ranges, up to 60 days ahead, at least an hour from now, and only where the host's calendar is free, repeating events included. The booking is inserted in one statement that re-checks for conflicts, so two guests cannot take the same slot. Mailflare does not email the guest a confirmation; the booking page confirms on screen.++On a Team license an administrator can add other users as hosts of a booking event. The booking is created on every host's calendar, and a slot is offered only when all hosts are free.++| Mailflare route | Purpose |+| --- | --- |+| `GET /api/booking`, `POST /api/booking` | List or create the signed-in user's booking events |+| `PATCH /api/booking/[eventId]`, `DELETE /api/booking/[eventId]` | Update or delete one |+| `PATCH /api/booking/settings` | Change the booking username (administrators) |+| `GET /api/public/booking?username=` | Public: the host's name and enabled events |+| `GET /api/public/booking/[eventId]?username=` | Public: one event and its open slots |+| `POST /api/public/booking/[eventId]?username=` | Public: book a slot (`{ name, email, startsAt, guestEmails?, notes? }`) |+## Account and mailbox managementAdmin > API keys can also grant the `accounts` and `mailboxes` scopes independently. These routes use `Authorization: Bearer <key>` and require the key owner to retain the admin role. Account management requires a Team license; creating a shared mailbox also requires a Team license. Each key can access only accounts created by its owner and mailboxes owned by those accounts or the admin.