SquatchMail.EmailEvent (SquatchMail v0.1.0)

Copy Markdown View Source

A downstream event observed for an email (delivery, open, click, bounce, etc.).

Events are keyed to emails by SES message_id. An event may be recorded before its email is known (e.g. an out-of-order webhook), in which case email_id is nil until the email is recorded and the event is back-linked.

Summary

Functions

Builds a changeset for an event. occurred_at defaults to now when omitted.

Types

t()

@type t() :: %SquatchMail.EmailEvent{
  __meta__: term(),
  email: term(),
  email_id: term(),
  event_type: term(),
  id: term(),
  inserted_at: term(),
  ip_address: term(),
  message_id: term(),
  occurred_at: term(),
  payload: term(),
  recipient: term(),
  updated_at: term(),
  url: term(),
  user_agent: term()
}

Functions

changeset(event, attrs)

@spec changeset(t(), map()) :: Ecto.Changeset.t()

Builds a changeset for an event. occurred_at defaults to now when omitted.