import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const baseTemplateTenantAssociation = await client.tenants.templates.retrieve('template_id', {
tenant_id: 'tenant_id',
});
console.log(baseTemplateTenantAssociation.id);{
"id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"published_at": "<string>",
"version": "<string>",
"data": {
"routing": {
"method": "all",
"channels": [
"<string>"
]
},
"content": {
"version": "<string>",
"elements": [
{
"type": "text",
"content": "<string>",
"align": "left",
"channels": [
"<string>"
],
"ref": "<string>",
"if": "<string>",
"loop": "<string>",
"text_style": "text",
"color": "<string>",
"bold": "<string>",
"italic": "<string>",
"strikethrough": "<string>",
"underline": "<string>",
"locales": {},
"format": "markdown"
}
],
"brand": "<string>"
}
}
}import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const baseTemplateTenantAssociation = await client.tenants.templates.retrieve('template_id', {
tenant_id: 'tenant_id',
});
console.log(baseTemplateTenantAssociation.id);{
"id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"published_at": "<string>",
"version": "<string>",
"data": {
"routing": {
"method": "all",
"channels": [
"<string>"
]
},
"content": {
"version": "<string>",
"elements": [
{
"type": "text",
"content": "<string>",
"align": "left",
"channels": [
"<string>"
],
"ref": "<string>",
"if": "<string>",
"loop": "<string>",
"text_style": "text",
"color": "<string>",
"bold": "<string>",
"italic": "<string>",
"strikethrough": "<string>",
"underline": "<string>",
"locales": {},
"format": "markdown"
}
],
"brand": "<string>"
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Id of the tenant for which to retrieve the template.
Id of the template to be retrieved.
The template's id
The timestamp at which the template was created
The timestamp at which the template was last updated
The timestamp at which the template was published
The version of the template
The template's data containing it's routing configs and Elemental content
Show child attributes
Show child attributes
For example, "2022-01-01"
Represents a body of text to be rendered inside of the notification.
Show child attributes
text The text content displayed in the notification. Either this field must be specified, or the elements field
Text alignment.
left, center, right Allows the text to be rendered as a heading level.
text, h1, h2, subtext Specifies the color of text. Can be any valid css color value
Apply bold to the text
Apply italics to the text
Apply a strike through the text
Apply an underline to the text
Region specific content. See locales docs for more details.
markdown