# MillionSend v0.1.0 - Table of Contents

> Official Elixir SDK for MillionSend — a self-hostable, Resend-compatible email API.

## Modules

- [MillionSend](MillionSend.md): Official Elixir client for [MillionSend](https://github.com/MillionSend/millionsend) —
a self-hostable, Resend-compatible email API.
- [MillionSend.Audiences](MillionSend.Audiences.md): Audiences — named contact lists. Resend-compatible, so a migrating app's
`audiences.*` calls port straight over. (MillionSend's dynamic-filter
`MillionSend.Segments` are a separate, richer resource.)

- [MillionSend.Audiences.Audience](MillionSend.Audiences.Audience.md): A named contact list.
- [MillionSend.Broadcasts](MillionSend.Broadcasts.md): Broadcasts. Create a draft, then `send/3` it (optionally scheduled).
- [MillionSend.Broadcasts.Broadcast](MillionSend.Broadcasts.Broadcast.md): A broadcast — an email sent to an audience or segment.
- [MillionSend.Client](MillionSend.Client.md): A resolved MillionSend client: API key, base URL, User-Agent and the HTTP
module to run requests through. Build one with `MillionSend.client/1`.

- [MillionSend.Contacts](MillionSend.Contacts.md): Contacts, addressable by id **or** email — email wins when both are given.
Pass `:audience_id` to scope a call to an audience; omit it for the top-level
contact routes.
- [MillionSend.Contacts.Contact](MillionSend.Contacts.Contact.md): A contact. `remove/2` populates `contact` (its id) plus `deleted`.
- [MillionSend.Emails](MillionSend.Emails.md): Send, fetch and cancel emails.
- [MillionSend.Emails.Email](MillionSend.Emails.Email.md): An email. `send/2` and `cancel/2` populate only `id`/`object`.
- [MillionSend.HTTP](MillionSend.HTTP.md): Behaviour for the swappable HTTP layer. The default is `MillionSend.HTTP.Req`;
tests inject a stub by building a client with `http_client:` set to a module
implementing this behaviour.

- [MillionSend.HTTP.Req](MillionSend.HTTP.Req.md): Default `MillionSend.HTTP` implementation, backed by Req.
- [MillionSend.List](MillionSend.List.md): The pagination envelope returned by list endpoints: `data` holds the cast
structs, `has_more` says whether another page exists. Paginate with the
`after:`/`before:` keyset cursors.

- [MillionSend.Segments](MillionSend.Segments.md): Dynamic segments — a saved filter over an audience's contacts. A MillionSend
extension with no Resend equivalent; the wire path is `/segments2`. `get/2`
returns a live `contact_count`.
- [MillionSend.Segments.Segment](MillionSend.Segments.Segment.md): A dynamic segment — a saved filter over an audience's contacts.
- [MillionSend.Topics](MillionSend.Topics.md): Subscription topics.
- [MillionSend.Topics.Topic](MillionSend.Topics.Topic.md): A subscription topic — a granular unsubscribe category.

- Exceptions
  - [MillionSend.Error](MillionSend.Error.md): The error every non-2xx response carries, plus the client-side/transport case.

