Skip to content

Commit

Permalink
Update sendTemplate
Browse files Browse the repository at this point in the history
Adding a complete example for use templates with Meta
  • Loading branch information
ozzyoss77 authored Oct 9, 2023
1 parent f42f8ec commit 8b77c06
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion packages/provider/src/meta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ class MetaProvider extends ProviderClass {
* @param {*} number
* @param {*} template
* @param {*} languageCode
* Usarse de acuerdo a cada plantilla en particular, esto solo es un mapeo de como funciona.
* @returns
*/

Expand All @@ -373,8 +374,49 @@ class MetaProvider extends ProviderClass {
language: {
code: languageCode, // examples: es_Mex, en_Us
},
components: [
{
type: 'header',
parameters: [
{
type: 'image',
image: {
link: 'https://i.imgur.com/3xUQq0U.png',
},
},
],
},
{
type: 'body',
parameters: [
{
type: 'text', // currency, date_time, etc
text: 'text-string',
},
{
type: "currency",
currency: {
fallback_value: "$100.99",
code: "USD",
amount_1000: 100990
}
},
]
},
{
type: 'button',
subtype: 'quick_reply',
index: 0,
parameters: [
{
type: 'payload',
payload: 'aGlzIHRoaXMgaXMgY29v'
},
],
},
]
},
}
};
return this.sendMessageMeta(body)
}

Expand Down

0 comments on commit 8b77c06

Please sign in to comment.