Created
July 7, 2024 08:29
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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