Skip to content

Instantly share code, notes, and snippets.

@gregg-cbs
Created July 7, 2024 08:29
Show Gist options
  • Save gregg-cbs/383db2a6ad69b98b022ecb9ad040c1be to your computer and use it in GitHub Desktop.
Save gregg-cbs/383db2a6ad69b98b022ecb9ad040c1be to your computer and use it in GitHub Desktop.
A gist to try figure out why only 50% of our whatsapp template messages arrive at our customers whatsapp
const whatsapp_payload = {
recipient_number: data.recipient_number,
template: { // template in meta dashboard
name: "order",
language: {
code: "en"
},
components: [
{
type: "header",
parameters: [
{
type: "document",
document: {
link: data.pdf_link,
filename: `${data.event_name} - Tickets #${data.order_id}.pdf`
}
},
]
},
{
type: "body",
parameters: [
{
type: "text",
text: data.firstname
},
{
type: "text",
text: data.event_name
},
{
type: "text",
text: data.event_start_date
},
{
type: "text",
text: data.event_end_date
},
{
type: "text",
text: data.event_url
},
{
type: "text",
text: organiser_details_string
},
]
}
]
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment