Email templates

The keenauth_email_template resource manages the published content of one customizable email template: one family (for example verify_email) in one locale. It needs the Startup plan or higher (403 plan_feature_unavailable otherwise).

resource "keenauth_email_template" "verify" {
  family    = "verify_email"
  locale    = "en"
  subject   = "Confirm your email"
  html      = "<p>Confirm your email address: <a href=\"{{ link }}\">Confirm</a></p>"
  text_body = "Confirm your email address: {{ link }}"
  from_name = "Acme"
}
Attribute Description
family, locale The slot. Changing either manages a different template.
subject Liquid, plain text, up to 200 characters, no line breaks.
html Liquid HTML fragment, up to 256 KiB.
text_body Liquid plain-text body (required), up to 64 KiB.
from_name Optional sender display name, up to 64 characters. Unset uses the application or environment name.
overwrite_pending_draft Optional, defaults to false. See below.
version, latest_version Read only. The published version, and the slot's newest version.

The server checks the content on write and again on publish: Liquid sandbox, balanced HTML, forbidden constructs, and the family's required {{ link }} or {{ code }} in both the HTML and the text body.

How a change is applied

  1. PUT writes the content as a new draft version. If-Match is the slot's newest version from the last read ("0" for a slot without versions).
  2. POST …:publish publishes that version. The previous version is archived and stays in the history (the newest 50 versions plus the published one are kept).

The resource reads the published version. A version published or rolled back in the dashboard shows up as drift in the next plan.

Pending drafts

A draft newer than the published version (saved in the dashboard, or left by a failed publish) is never overwritten silently:

If someone writes to the template between plan and apply, the API answers 412 and nothing changes. Run plan again.

Create, import and destroy