Open dardoguidobono opened 2 years ago
Hello @dardoguidobono Thanks for the suggestion, if I understood correctly its about Interactive Message Templates, ill work on that and update asap or you can create a pull request if you already have one. It should be available soon.
currently i don't have it sorted yet, the 3rd parameter for send_template is optional
send_template($template, $recipient_id, $lang = "en_US")
so probably i have to add 3 new arrays of parameters for the sections header, body, and button.
and add the different kind of parameter classes ( Text, Date, Currency, Etc).
send_template($template, $recipient_id, $lang = "en_US", $parameters_header = [], $parameters_body = [], $parameters_button = [])
or create a new function with the extended parameters.
D.
I have just created a similar package with support for template components. Should we unify both projects and collaborate together?
I have just created a similar package with support for template components. Should we unify both projects and collaborate together?
Yes Please !
how can we use variables in template ?
Hi! any news about request?
You can use it now like this
Sample
$tsap->sendTemplate('template_name', '6283xxxxxx', 'en_US', [ "Hello World", ]);
equivalent to
$tsap->sendTemplate('template_name', '6283xxxxxx', 'en_US', [ [ "type" => "text", "text" => "Hello World" ], ]);
https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-message-templates
add support for setting the header parameters
{ "messaging_product": "whatsapp", "to": "5XXXXXXXXXXX", "type": "template", "template": { "name": "test_template", "language": { "code": "es_MX" }, "components": [{ "type": "header", "parameters": [ { "type": "text","text": "111" } ] } ] } }
and body parameters like this{ "messaging_product": "whatsapp", "to": "5XXXXXXXXXXX", "type": "template", "template": { "name": "prueba_confirmacion_turno", "language": { "code": "es_MX" }, "components": [{ "type": "body", "parameters": [ { "type": "text","text": "111" },{ "type": "text","text": "222" },{ "type": "text","text": "333" },{ "type": "text","text": "444" } ] } ] } }