SaltDns.Registrar.Reminders (Salt v1.0.0)

Expiry reminders for registrar domains: an e-mail to the owners and admins of the organisation that holds the domain, 60, 30 and 7 days before it expires.

The job runs once a day (SaltDns.Registrar.Worker, task "remind") while the registrar is on. A reminder is sent at most once per domain and step: the send is recorded as a domain.expiry_reminder registrar event with the step in detail.days, and a step whose event exists is not sent again. A domain with automatic renewal on is skipped, and so is an expired one: the registrar renews the first, and the second is for the console.

Mail goes through SaltDns.Mailer (Swoosh), so it leaves through whatever relay is configured; Karta's SMTP is one such relay. With mail delivery off (SaltDns.Accounts.mail_delivery?/0, the default in production) nothing is sent and nothing is recorded, so switching mail on later still sends the reminders that are due.

Reading this file is the whole list of what it does: it never calls the registrar and never changes a domain.

Summary

Types

A domain due a reminder: the domain, the step in days and the days left.

Functions

The text of the reminder e-mail for domain with days_left days left.

The domains due a reminder at now, one entry per domain per step not sent yet. Reads the database; sends nothing.

Sends every reminder that is due and returns the counts: %{sent: n, failed: n, skipped: n}. A skipped one has no recipient (nobody is owner or admin of the organisation); it is not recorded, so it is tried again the next day.

The reminder steps, in days before expiry.

Types

due()

@type due() :: %{
  domain: SaltDns.Registrar.Domain.t(),
  step: pos_integer(),
  days_left: integer()
}

A domain due a reminder: the domain, the step in days and the days left.

Functions

body(domain, days_left)

The text of the reminder e-mail for domain with days_left days left.

due(now \\ DateTime.utc_now())

@spec due(DateTime.t()) :: [due()]

The domains due a reminder at now, one entry per domain per step not sent yet. Reads the database; sends nothing.

send_due(now \\ DateTime.utc_now())

@spec send_due(DateTime.t()) :: %{
  sent: non_neg_integer(),
  failed: non_neg_integer(),
  skipped: non_neg_integer()
}

Sends every reminder that is due and returns the counts: %{sent: n, failed: n, skipped: n}. A skipped one has no recipient (nobody is owner or admin of the organisation); it is not recorded, so it is tried again the next day.

steps()

@spec steps() :: [pos_integer()]

The reminder steps, in days before expiry.