# `Chime.Channels.Email`
[🔗](https://github.com/hattoriai/chime/blob/v0.1.0-dev/lib/chime/channels/email.ex#L1)

The `:email` channel: the notifier's `c:Chime.Notifier.email/3`, sent
with the app's mailer (`:mailer` in `Chime.Config`).

The notifier gives the subject and the body. Chime gives the email:

  * its `To:`, the person's address and name (a person with no address
    is skipped, and the log says so);
  * its `From:`, the config's `:email_from`, unless the notifier set one;
  * unless the notification is required, the headers of one-click
    unsubscribe (RFC 8058), which Gmail and Yahoo ask of a sender of
    many emails: `List-Unsubscribe` with the address of the person's
    link, and `List-Unsubscribe-Post`. The same address is in the
    email's `assigns` as `:unsubscribe_url`, for a link in its footer,
    and the notifier's email can use `Chime.unsubscribe_url/2`. They
    need `:mail_url` and `:secret_key_base` in the config;
  * the link that opens the notification and reads it in the feed, from
    the feed's `:url`, in `assigns` as `:link` (`Chime.link/2`).

The mailer's id of the email (`{:ok, %{id: id}}`) is kept as the
delivery's ref, to match the provider's events later.

---

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