MishkaCmsCore.Mail.Delivery (Mishka CMS Core v0.0.1)

Copy Markdown View Source

One email the CMS sent, or tried to (cms_mail_deliveries): who it was for, what it was for, which provider took it and how that went. Never the body: a password-reset or magic-link email carries a sign-in token.

Written by MishkaCmsCore.Mail alone (authorize?: false): a row is made :queued when an email is handed over, and :mark moves it to :sent or :failed as the provider answers, or records :not_configured when the site has no provider. A site's rows older than mailer.history_days go when it next sends (MishkaCmsCore.Mail.prune/1).

Read by whoever may change the site's settings (admin:dashboard:setting): a site's admins see their own site's rows, a master (site_id nil) every site's and the installation's own. The settings page's Email tab lists them.

Summary

Functions

Validates that the keys in the provided input are valid for at least one action on the resource.

Same as input/1, except restricts the keys to values accepted by the action provided.

Types

t()

@type t() :: %MishkaCmsCore.Mail.Delivery{
  __lateral_join_source__: term(),
  __meta__: term(),
  __metadata__: term(),
  __order__: term(),
  aggregates: term(),
  attempts: term(),
  calculations: term(),
  error: term(),
  id: term(),
  inserted_at: term(),
  message_id: term(),
  provider: term(),
  purpose: term(),
  recipient: term(),
  site: term(),
  site_id: term(),
  status: term(),
  subject: term(),
  updated_at: term()
}

Functions

default_short_name()

input(opts)

@spec input(values :: map() | Keyword.t()) :: map() | no_return()

Validates that the keys in the provided input are valid for at least one action on the resource.

Raises a KeyError error at compile time if not. This exists because generally a struct should only ever be created by Ash as a result of a successful action. You should not be creating records manually in code, e.g %MyResource{value: 1, value: 2}. Generally that is fine, but often with embedded resources it is nice to be able to validate the keys that are being provided, e.g

Resource
|> Ash.Changeset.for_create(:create, %{embedded: EmbeddedResource.input(foo: 1, bar: 2)})
|> Ash.create()

input(opts, action)

@spec input(values :: map() | Keyword.t(), action :: atom()) :: map() | no_return()

Same as input/1, except restricts the keys to values accepted by the action provided.

primary_key_matches?(left, right)