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

Supporting media message template from whatsapp. #378

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Robi9
Copy link
Contributor

@Robi9 Robi9 commented Sep 9, 2021

Openning this PR to support template media message from whatsapp according to #366

@matmsa27
Copy link
Contributor

Hi @rowanseymour , any news to review this PR? We running this on our fork for the last 3 weeks and works properly.

@rowanseymour
Copy link
Member

@matmsa27 sorry this fell off the radar - the diff looks like gofmt hasn't been run as it's kinda hard to read - can someone clean that up

@matmsa27
Copy link
Contributor

Hi @rowanseymour , no problem. Sure, thanks for the feedback and support. @Robi9 will run and update the PR.

@Robi9
Copy link
Contributor Author

Robi9 commented Sep 22, 2021

I made the changes that were suggested.

@norkans7
Copy link
Contributor

I am wondering how we are syncing the image templates on RapidPro side as we only consider text templates @Robi9 @matmsa27

https://github.com/nyaruka/rapidpro/blob/e6b69b1f76963d19ad7b6d145f6423a9583f6d87/temba/utils/whatsapp/tasks.py#L116

What happens if we try to add an attachment on a template that did not have the image defined?
How do we know the templates where the attachment was defined or not?

@matmsa27
Copy link
Contributor

matmsa27 commented Sep 27, 2021

Hi @norkans7 , actually we are only supporting sending the template message with this PR on Courier side on this phase. I believe that we need more improvements on the Rapidpro Django side to sync the template messages with media and on the flow editor to support the template with media to be more clear to the user about the template selected to send on the card.

In the next steps is interesting to improve the models about the templates, sync method template to save information about the type of template (media or text), if media save what the type of media (document, video or image). And in the other side change the flow editor to knows when template media is selected to guide the user to add the correct media to the template.

About the syncing, we are putting the templates manually on the RapidPro database, and with this PR we select the template on flow editor and add the attachment according to the template, this works as well in this first stage.

What happens if we try to add an attachment on a template that did not have the image defined?

The courier will try to send the template with media, and WhatsApp will return an error. The idea is, the user that is configuring the flow and the template message knows if the template supports the template message or not.

How do we know the templates where the attachment was defined or not?

Actually, only the users that have access to WhatsApp account on Facebook business and the organization on RapidPro.

@norkans7
Copy link
Contributor

I think this can wait the changes you mentioned needed on RapidPro and the flow editor and the use of attachments seems like a quick hack but will be broken when we add the proper support for the media of templates as the editor will probably have a field for the media as we do for the variables..

I think we can be patient on this a little more so we think a proper way to support other message templates types.

@matmsa27
Copy link
Contributor

I believe this PR is a first phase to support this in general on Rapidpro.

I think this can wait the changes you mentioned needed on RapidPro and the flow editor and the use of attachments seems like a quick hack but will be broken when we add the proper support for the media of templates as the editor will probably have a field for the media as we do for the variables..

Can we do a migration to change the media setuped to the new way when flow editor will change?

We are open to implement this on Rapidpro django side and discuss the changes on flow editor. We can prototype and discuss before the implementation starts.

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

Successfully merging this pull request may close these issues.

4 participants