Documentation
Sign inGet started

bird email templates preview

Usage

Ejemplo de código
bird email templates preview <template-ref> [flags]

Description

Render a template with sample values
Returns the subject and the HTML and plain-text bodies a send would deliver, so you can check a draft before submitting it. Renders the draft by default; pass --version to render a published version instead. Works for your own templates and for Bird's built-in ones. Nothing is sent and nothing is changed.
Build the request from the <template_ref> argument and flags, a JSON EmailTemplatePreviewRequest body via --body-file ("-" reads stdin), or both — an inline value 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.

Examples

Ejemplo de código
# print the body shape (no credentials needed)
bird email templates preview --example

# the body it prints:
Ejemplo de código
{
  "language": "pt-BR",
  "parameters": {
    "animal": "otter",
    "bird": {
      "contact": {
        "first_name": "Ada"
      }
    }
  },
  "version": "emv_01krdgeqcxet5s7t44vh8rt9mg"
}
Ejemplo de código
# render the draft with one variable filled in
bird email templates preview welcome-email --parameters '{"first_name":"Ada"}'

# render a published version in Brazilian Portuguese
bird email templates preview welcome-email --version emv_01krdgeqcxet5s7t44vh8rt9mh --language pt-BR

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
--parametersSample values for the template's variables, as a JSON object (e.g. {"first_name":"Ada"})
--languageWhich of the template's languages to render. Omit it to render the default; the template's on_missing_language decides what an absent language does, exactly as it would on a send.
--versionPreview a published version by its id instead of the current draft.
--response-schemaPrint the fields this command returns, then exit
NameDescription
bird email templates createCreate an email template and its first editable draft
bird email templates deleteDelete an email template
bird email templates duplicateDuplicate an email template
bird email templates getGet an email template
bird email templates listList email templates
bird email templates updateUpdate an email template