Constructor
new Parameter(parameter, whoamiopt)
- Source:
Properties:
Name |
Type |
Attributes |
Description |
type |
String
|
|
The type of the parameter |
text |
String
|
<optional>
|
The text of the parameter |
currency |
Currency
|
<optional>
|
The currency of the parameter |
datetime |
DateTime
|
<optional>
|
The datetime of the parameter |
image |
Image
|
<optional>
|
The image of the parameter |
document |
Document
|
<optional>
|
The document of the parameter |
video |
Video
|
<optional>
|
The video of the parameter |
Builds a parameter object for a HeaderComponent or BodyComponent.
For Text parameter, the header component character limit is 60, and the body component character limit is 1024.
For Document parameter, only PDF documents are supported for document-based message templates.
Parameters:
Name |
Type |
Attributes |
Description |
parameter |
Text
|
Currency
|
DateTime
|
Image
|
Document
|
Video
|
|
The parameter to be used in the template |
whoami |
String
|
<optional>
|
The parent component, used to check if a Text object is too long. Can be either 'header' or 'body' |
Throws:
-
-
If parameter is not provided
-
-
Type
-
Error
-
-
If parameter is a Text and the parent component (whoami) is "header" and the text over 60 characters
-
-
Type
-
Error
-
-
If parameter is a Text and the parent component (whoami) is "body" and the text over 1024 characters
-
-
Type
-
Error