"comment".
When to use:
- Document complex template logic
- Add notes for other developers
- Organize and label sections of your template
- Include metadata that shouldn’t appear in notifications
Comments are ignored at render time and never appear in the output, on any channel.
{
"type": "comment",
"comment": "This is a comment that will not be rendered in the output"
}
const { requestId } = await client.send.message({
message: {
to: {
email: "sarah@acme-corp.com",
},
content: {
version: "2022-01-01",
elements: [
{
type: "comment",
comment: "This is a comment that will not be rendered in the output",
},
],
},
},
});
response = client.send.message(
message={
"to": {
"email": "sarah@acme-corp.com",
},
"content": {
"version": "2022-01-01",
"elements": [
{
"type": "comment",
"comment": "This is a comment that will not be rendered in the output",
},
],
},
},
)
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": "comment",
"comment": "This is a comment that will not be rendered in the output"
}
]
}
}
}'
response = courier.send_.message(
message: {
to: {
email: "sarah@acme-corp.com"
},
content: {
version: "2022-01-01",
elements: [
{
type: "comment",
comment: "This is a comment that will not be rendered in the output"
}
]
}
}
)
// 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": "comment",
"comment": "This is a comment that will not be rendered in the output"
}
]
}`))
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},
},
})
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", "comment",
"comment", "This is a comment that will not be rendered in the output")))))
.build())
.build();
SendMessageResponse response = client.send().message(params);
$response = $client->send->message(
message: [
'to' => [
'email' => 'sarah@acme-corp.com',
],
'content' => [
'version' => '2022-01-01',
'elements' => [
[
'type' => 'comment',
'comment' => 'This is a comment that will not be rendered in the output',
],
],
],
],
);
// 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": "comment",
"comment": "This is a comment that will not be rendered in the output"
}
]
}
""")),
},
};
var response = await client.Send.Message(parameters);
courier send message \
--api-key "$COURIER_API_KEY" \
--message.to '{"email": "sarah@acme-corp.com"}' \
--message.content '{"version": "2022-01-01", "elements": [{"type": "comment", "comment": "This is a comment that will not be rendered in the output"}]}'
With Courier MCP, send an email to sarah@acme-corp.com and leave a comment element noting who owns the copy.
string
The comment text. It is not rendered in the output.
any
An optional object alongside the comment. Holds metadata, structured notes, or other context that is not rendered.
{
"type": "comment",
"comment": "This section handles order confirmations"
}
{
"type": "comment",
"comment": "A/B test variant A - shows promotional content",
"object": {
"test_id": "promo_ab_test",
"variant": "A",
"author": "team-marketing",
"last_updated": "2024-01-15"
}
}
{
"version": "2022-01-01",
"elements": [
{
"type": "comment",
"comment": "=== HEADER SECTION ==="
},
{
"type": "meta",
"title": "Order Confirmation"
},
{
"type": "image",
"src": "https://example.com/logo.png"
},
{
"type": "comment",
"comment": "=== MAIN CONTENT ==="
},
{
"type": "text",
"content": "Your order has been confirmed!"
},
{
"type": "comment",
"comment": "=== FOOTER SECTION ==="
},
{
"type": "text",
"content": "Questions? Contact support@acme-corp.com"
}
]
}