Constructor
new Template(name, language, …componentsopt)
- Source:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String | The name of the template | |
language |
Language | The language of the template | |
components |
Array.<(HeaderComponent|BodyComponent|ButtonComponent)> |
<optional> |
The components of the template |
_ |
String | The type of the object, for internal use only |
Create a Template object for the API
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String | Name of the template | |
language |
String | Language | The code of the language or locale to use. Accepts both language and language_locale formats (e.g., en and en_US). | |
components |
HeaderComponent | BodyComponent | ButtonComponent |
<optional> <repeatable> |
Components objects containing the parameters of the message. For text-based templates, the only supported component is BodyComponent. |
Throws:
-
-
If name is not provided
- Type
- Error
-
-
-
If language is not provided
- Type
- Error
-