Sign inGet Started

bird email templates versions languages set

Usage

Exemple de code
bird email templates versions languages set <template-ref> <version-id> <language> [flags]

Description

Upsert one language of a draft

Save one language's full content on a template's draft, creating the language if the draft does not have it yet. The response carries compatibility: what the saved HTML uses that mail clients remove, ignore, or render inconsistently, each finding naming the pattern, its line and column, and what to use instead. Advisory: the language is saved either way, and compatibility_severity of problem means part of the content does nothing at all in the clients the finding names. To link reusable blocks, send shared_blocks with one HTML comment marker bird:shared-block:UUID per binding in html and the revision read with authoring true (0 for a new language). A language edited in the Bird dashboard's visual editor refuses this save.

Build the request from flags, a JSON EmailTemplateLanguageUpsert body via --body-file ("-" reads stdin), or both — a flag overrides the matching body field. Run --example to print a ready-to-edit body, or --dry-run to print the resolved request without sending it.

Procedure

Step 2 of 3 of "Author a template and make it sendable". Previous: bird email templates create. Next: bird email templates versions submit. Step 6 of 7 of "Author a reusable email section and link it into templates". Previous: bird email templates versions languages get. Next: bird email templates versions submit.

Examples

Exemple de code
# print the body shape (no credentials needed)
bird email templates versions languages set --example

# the body it prints:
Exemple de code
{
  "html": "<h1>Hi {{ bird.contact.first_name }}</h1>",
  "preview_text": "{{ bird.contact.first_name }}, your order is on its way",
  "subject": "Welcome to Acme, {{ bird.contact.first_name }}!"
}

Options

Request

NameDescription
--body-fileRead the JSON request body from this file; "-" reads stdin
--examplePrint a complete example request body, then exit
--dry-runPrint the resolved request without sending it, then exit
--idempotency-keyDeduplication key; a retry with the same key won't act twice

Options

NameDescription
--replace-custom-textConfirms replacing the language's custom plain-text body with text derived from the linked HTML, in the same save that links its first block. Requires shared_blocks and the language revision.
--subjectThe email subject line. It may be empty in a draft but is required to publish. (required; or in --body-file)
--preview-textThe line an inbox shows after the subject in the message list. Leave it out and the inbox shows the opening words of the body instead.
--htmlThe HTML body for this language. On a language that links blocks, a save without shared_blocks is refused (E04109); read it with authoring=true for the HTML with its block markers first.
--textThe plain-text body for this language. Omit it and a plain-text alternative is derived from the HTML when you submit.
--revision <n>The revision you last read for this language, to detect a concurrent edit. The save is rejected with a conflict if the language moved on since. Omit it to save unconditionally. Creating a language does not need one.
--response-schemaPrint the fields this command returns, then exit
NameDescription
bird email templates versions languages deleteDelete one language from a draft
bird email templates versions languages getGet one language of a version
bird email templates versions languages listList a version's languages
bird email templates versions languages updateUpdate one language of a draft