Skip to main content

WhatsApp Template

The whatsapptemplate component allows you to send WhatsApp templates in the bot actions.

Properties

PropertyTypeDescriptionRequiredDefault value
namestringName of the templateYes-
namespacestringNamespace of the template. Beginning with v2.27.8, this must be the namespace associated with the WhatsApp business account that owns the phone number associated with the current WhatsApp Business API client or the message will fail to sendYes-
languagestringLanguage of the templateYes-
headerobjectHeader of the templateNo-
bodyobjectBody of the templateNo-
footerobjectFooter of the templateNo-

Example

Example of ./actions/example-whatsapp-template.js

import React from 'react'
import { WhatsappTemplate } from '@botonic/react'

export default class extends React.Component {
render() {
return (
<WhatsappTemplate
name={'out_of_office'}
namespace={'d32863cc_3dd6_3e84_74c0_38d758fc60f6'}
language={'en'}
header={''}
body={{
type: 'body',
parameters: [{ type: 'text', text: 'Anthony' }],
}}
footer={''}
></WhatsappTemplate>
)
}
}