Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WhatsApp Template Message Media Support #366

Closed
matmsa27 opened this issue Jul 21, 2021 · 8 comments
Closed

WhatsApp Template Message Media Support #366

matmsa27 opened this issue Jul 21, 2021 · 8 comments

Comments

@matmsa27
Copy link
Contributor

Hello everyone, WhatsApp provides support to template message with media, but on Rapidpro only support Template Message with Text. Can we planning here to support this?

Reference: https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/media-message-templates/

@rasoro
Copy link
Contributor

rasoro commented Jul 22, 2021

I believe this would be possible by adding new fields to the templatePayload struct that already exists.

Highlighting here some things we noticed in small tests we did. As an example media files receive url where the files are stored, and with that we would take advantage of the attachments tab in the "send message".

but we would have to see in more detail how to handle the template update tasks.

@matmsa27
Copy link
Contributor Author

Hi @nicpottier and @rowanseymour, what do you think about this on Rapidpro?

@matmsa27
Copy link
Contributor Author

Hello everyone, can we discuss this point? we are very excited here to implement this and open the PR.

@matmsa27
Copy link
Contributor Author

Hi @ericnewcomer , I would like to discuss this with you, what do you think?

@rowanseymour
Copy link
Member

I think we can certainly add support for this and I'm trying to understand what that entails. Does this require supporting a new API version? I'm looking at the existing template sync code and it assumes templates are made up of component types HEADER, BODY, FOOTER, but these docs show templates as being header|image|document, body..

@rasoro
Copy link
Contributor

rasoro commented Aug 12, 2021

I would like to mention that, i think the component types still are HEADER, BODY and FOOTER, but only in HEADER component has a (optional) field named FORMAT that can be: TEXT || IMAGE || DOCUMENT || VIDEO.

https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates#creating-message-templates

@Robi9
Copy link
Contributor

Robi9 commented Aug 23, 2021

For the addition of a media message template, the following modifications were thought:
To find out if it is a media or text template, an identification field must be added so that it is possible to know if that object created in RapidPro is a template and what its type is (media or text).

If it is identified that the template is a media template, in the Courier the modification of the TemplatePayload must occur, in which the Components can be of 3 types: header, body and footer. These types must be added, currently only the body type is implemented. In addition, Param must also accept text, currency, date_time, image, document and video. Currently Param only accepts text and it already fulfills the role of currency and date_time types, so would it still be necessary to add these types?

After these modifications, it will only be necessary to add the treatment of this type of template in the Courier's WhatsApp handler, more specifically in the buildPayloads function.

@rowanseymour
Copy link
Member

I think as a first go you could just make it work for images.. whilst leaving the door open to supporting all possible types one day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants