> ## Documentation Index
> Fetch the complete documentation index at: https://www.courier.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Install the Courier skill before writing code: `npx skills add trycourier/courier-skills`. It carries the verified SDK shapes and the rules you cannot get wrong.
> Authenticate every request with `Authorization: Bearer <API_KEY>`. A workspace has several environments and each has its own keys, which are plain `pk_` strings with no environment prefix. Start with Test.
> Send with `client.send.message`, the default import of the v7 Node SDK. Reference a template by its `nt_` id or its alias.
> A send accepts a bare Elemental element list, but storing content on a template requires the top-level elements wrapped in a channel element.
> Templates and journeys can be built in the Courier app or created through the API. Either way they live in the workspace and are referenced by ID when you send.
> The hosted MCP server is https://mcp.courier.com. For a briefing on what Courier is and when to use it, read https://www.courier.com/llms.txt.
> Prefer the Guides tab for how-do-I questions and the Docs tab for how-does-it-behave questions. The API reference lives under /api-reference.

# Elemental meta element

> Set the title, which becomes the email subject and push title.

export const Doc = ({href, children, name, bare}) => {
  const label = children || name || href;
  if (bare) {
    return <a href={href}>{label}</a>;
  }
  return <a className="cx-endpoint" data-kind="doc" href={href}>
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method">DOC</span>
    </a>;
};

The meta element describes the notification for the channel or provider rendering it. Its `title` field becomes the title on channels that support one, such as email subject lines and push titles. The type value is `"meta"`.

**When to use:**

* Set email subject lines
* Set push notification titles
* Provide channel-specific titles
* Include metadata for notification processing

**Basic example**

<CodeGroup>
  ```json Elemental theme={null}
  {
    "type": "meta",
    "title": "Thank you for signing up!"
  }
  ```

  ```javascript Node.js highlight={9-12} theme={null}
  const { requestId } = await client.send.message({
    message: {
      to: {
        email: "sarah@acme-corp.com",
      },
      content: {
        version: "2022-01-01",
        elements: [
          {
            type: "meta",
            title: "Thank you for signing up!",
          },
        ],
      },
    },
  });
  ```

  ```python Python highlight={9-12} theme={null}
  response = client.send.message(
      message={
        "to": {
          "email": "sarah@acme-corp.com",
        },
        "content": {
          "version": "2022-01-01",
          "elements": [
            {
              "type": "meta",
              "title": "Thank you for signing up!",
            },
          ],
        },
      },
  )
  ```

  ```bash cURL highlight={12-15} theme={null}
  curl -X POST https://api.courier.com/send \
    -H "Authorization: Bearer $COURIER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
        "message": {
          "to": {
            "email": "sarah@acme-corp.com"
          },
          "content": {
            "version": "2022-01-01",
            "elements": [
              {
                "type": "meta",
                "title": "Thank you for signing up!"
              }
            ]
          }
        }
      }'
  ```

  ```ruby Ruby highlight={9-12} theme={null}
  response = courier.send_.message(
    message: {
      to: {
        email: "sarah@acme-corp.com"
      },
      content: {
        version: "2022-01-01",
        elements: [
          {
            type: "meta",
            title: "Thank you for signing up!"
          }
        ]
      }
    }
  )
  ```

  ```go Go highlight={5-8} theme={null}
  // Elemental nodes carry no typed content fields, so pass the document as raw JSON.
  content := param.Override[shared.ElementalContentParam](json.RawMessage(`{
    "version": "2022-01-01",
    "elements": [
      {
        "type": "meta",
        "title": "Thank you for signing up!"
      }
    ]
  }`))

  response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
  	Message: courier.SendMessageParamsMessage{
  		To: courier.SendMessageParamsMessageToUnion{
  			OfUserRecipient: &shared.UserRecipientParam{
  				Email: courier.String("sarah@acme-corp.com"),
  			},
  		},
  		Content: courier.SendMessageParamsMessageContentUnion{OfElementalContent: &content},
  	},
  })
  ```

  ```java Java highlight={7-9} theme={null}
  SendMessageParams params = SendMessageParams.builder()
      .message(SendMessageParams.Message.builder()
          .to(JsonValue.from(java.util.Map.of("email", "sarah@acme-corp.com")))
          .content(JsonValue.from(java.util.Map.of(
                  "version", "2022-01-01",
                  "elements", java.util.List.of(
                    java.util.Map.of(
                      "type", "meta",
                      "title", "Thank you for signing up!")))))
          .build())
      .build();
  SendMessageResponse response = client.send().message(params);
  ```

  ```php PHP highlight={9-12} theme={null}
  $response = $client->send->message(
    message: [
      'to' => [
        'email' => 'sarah@acme-corp.com',
      ],
      'content' => [
        'version' => '2022-01-01',
        'elements' => [
          [
            'type' => 'meta',
            'title' => 'Thank you for signing up!',
          ],
        ],
      ],
    ],
  );
  ```

  ```csharp C# highlight={12-15} theme={null}
  // Elemental nodes expose no typed content fields, so build the document from raw JSON.
  SendMessageParams parameters = new()
  {
      Message = new()
      {
          To = new UserRecipient { Email = "sarah@acme-corp.com" },
          Content = ElementalContent.FromRawUnchecked(
              JsonSerializer.Deserialize<Dictionary<string, JsonElement>>("""
              {
                "version": "2022-01-01",
                "elements": [
                  {
                    "type": "meta",
                    "title": "Thank you for signing up!"
                  }
                ]
              }
              """)),
      },
  };

  var response = await client.Send.Message(parameters);
  ```

  ```bash CLI highlight={4} theme={null}
  courier send message \
    --api-key "$COURIER_API_KEY" \
    --message.to '{"email": "sarah@acme-corp.com"}' \
    --message.content '{"version": "2022-01-01", "elements": [{"type": "meta", "title": "Thank you for signing up!"}]}'
  ```

  ```text MCP theme={null}
  With Courier MCP, send an email to sarah@acme-corp.com and set its subject line with a meta element.
  ```
</CodeGroup>

**Fields**

<ParamField path="title" type="string">
  The title to be displayed by supported channels:

  * **Email**: Used as the email subject line
  * **Push**: Used as the push notification title
  * **Inbox**: Used as the notification title

  Supports Handlebars variables.
</ParamField>

<ParamField path="locales" type="object">
  Region-specific content for localization. Can localize the `title` field. See the <Doc href="/docs/design/elemental/locales">Locales documentation</Doc>.
</ParamField>

<ParamField path="channels" type="string[]">
  An array of channel names. The meta element applies only to the listed channels. See <Doc href="/docs/design/elemental/control-flow#channels">Control flow</Doc>.
</ParamField>

**Examples and variants**

**Basic title**

Simple title for email subject or push notification:

```json theme={null}
{
  "type": "meta",
  "title": "Thank you for signing up!"
}
```

**Dynamic title with Handlebars**

Use variables in the title:

```json theme={null}
{
  "type": "meta",
  "title": "Hello, {{first_name}} {{last_name}}"
}
```

The variables come from `message.data` (e.g., `data.first_name`, `data.last_name`).

**Channel-specific titles**

Different titles for different channels:

```json theme={null}
{
  "type": "meta",
  "channels": ["email"],
  "title": "Order Confirmation - Check Your Email"
},
{
  "type": "meta",
  "channels": ["push"],
  "title": "Order Confirmed!"
},
{
  "type": "meta",
  "channels": ["sms"],
  "title": "Order #{{order_id}} confirmed"
}
```

**Localized titles**

Localize titles for different languages:

```json theme={null}
{
  "type": "meta",
  "title": "Welcome!",
  "locales": {
    "es": {
      "title": "¡Bienvenido!"
    },
    "fr": {
      "title": "Bienvenue!"
    },
    "de": {
      "title": "Willkommen!"
    }
  }
}
```

**Combined dynamic and localized**

Use both Handlebars and localization:

```json theme={null}
{
  "type": "meta",
  "title": "Order #{{order_id}} Confirmed",
  "locales": {
    "es": {
      "title": "Pedido #{{order_id}} Confirmado"
    },
    "fr": {
      "title": "Commande #{{order_id}} Confirmée"
    }
  }
}
```

**Multiple meta elements**

Use multiple meta elements for different purposes:

```json theme={null}
{
  "version": "2022-01-01",
  "elements": [
    {
      "type": "meta",
      "channels": ["email"],
      "title": "Your Weekly Newsletter"
    },
    {
      "type": "meta",
      "channels": ["push"],
      "title": "New Newsletter Available"
    },
    {
      "type": "text",
      "content": "Check out this week's updates..."
    }
  ]
}
```

**Channel usage**

**Email**: the `title` field becomes the email subject line.

**Push notifications**: the `title` field becomes the push notification title. Keep it concise, typically 40-60 characters.

**SMS**: meta elements are typically unused, since SMS has no title or subject.

**Inbox**: the `title` field becomes the notification title in the inbox.
