BaseMessage
<MessageTypeEnum.Template
>new TemplateMessage(params
):TemplateMessage
LanguageEnum
• params.templateName: string
TemplateMessage
BaseMessage<MessageTypeEnum.Template>.constructor
data: object
language: LanguageEnum
templateName: string
TemplateMessageInterface
.data
messaging_product: "whatsapp"
The messaging product.
TemplateMessageInterface
.messaging_product
BaseMessage.messaging_product
recipient_type: "individual"
The recipient type.
TemplateMessageInterface
.recipient_type
BaseMessage.recipient_type
type: MessageTypeEnum
The type of the message.
TemplateMessageInterface
.type
BaseMessage.type
addComponent(): void
Adds a component to the template message.
void
Parses the constructor payload using the provided schema.protected
parseConstructorPayload(schema
,payload
):any
ZodType
<any
, ZodTypeDef
, any
>
The Zod schema used for parsing the payload.
• payload: any
The payload to be parsed.
any
The parsed data.
BaseMessage.parseConstructorPayload
toJson(Converts the template message to a JSON object.params
):object
string
• params.to: string
object
The JSON object representing the template message.
optional
biz_opaque_callback_data:string
optional
context:object
message_id: string
messaging_product: "whatsapp"
recipient_type: "individual"
template: object
optional
components: (object
|object
|object
)[]
language: object
code: LanguageEnum
policy: "deterministic"
name: string
to: string
type: Template
BaseMessage.toJson