# `Bamboo.SentEmail`
[🔗](https://github.com/thoughtbot/bamboo/blob/main/lib/bamboo/sent_email.ex#L1)

Used for storing and retrieving sent emails when used with `Bamboo.LocalAdapter`.

When emails are sent with the `Bamboo.LocalAdapter`, they are stored in
`Bamboo.SentEmail`. Use the functions in this module to store and retrieve the emails.

Remember to start the Bamboo app by adding it to the app list in `mix.exs` or
starting it with `Application.ensure_all_started(:bamboo)`

# `all`

Returns a list of all sent emails

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `get`

Gets an email by id. Returns nil if it can't find a matching email.

# `get!`

Gets an email by id. Raises if it can't find one.

# `get_id`

Gets the email's id.

The email must be an email that was sent with `Bamboo.LocalAdapter` or added
via `Bamboo.SentEmail.push/1`, otherwise the id will not have been set.

# `one`

Returns exactly one sent email. Raises if none, or more than one are found

Raises `NoDeliveriesError` if there are no emails. Raises `DeliveriesError` if
there are 2 or more emails.

# `push`

Adds an email to the list of sent emails.

Adds an email to the beginning of the sent emails list. Also gives the email
an id that can be fetched with `Bamboo.SentEmail.get_id/1`.

# `reset`

Clears all sent emails

# `start_link`

Starts the SentEmail Agent

---

*Consult [api-reference.md](api-reference.md) for complete listing*
