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

Support messaging over WhatsApp (foundation only) #1611

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

djamg
Copy link
Contributor

@djamg djamg commented Jan 31, 2023

No description provided.

funnel/transports/base.py Outdated Show resolved Hide resolved
funnel/transports/whatsapp.py Outdated Show resolved Hide resolved
funnel/transports/whatsapp.py Outdated Show resolved Hide resolved
funnel/transports/whatsapp.py Outdated Show resolved Hide resolved
funnel/transports/whatsapp.py Outdated Show resolved Hide resolved
funnel/transports/whatsapp.py Outdated Show resolved Hide resolved
funnel/transports/whatsapp.py Outdated Show resolved Hide resolved
funnel/views/notification.py Outdated Show resolved Hide resolved
funnel/views/notification.py Outdated Show resolved Hide resolved
@jace jace changed the title added whatsapp transport Support messaging over WhatsApp (foundation only) Nov 15, 2023
@jace jace marked this pull request as ready for review November 15, 2023 07:48
Copy link
Member

@jace jace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some security issues and optimizations to handle.

# Register the fact that we got a WhatsApp event.
# If there are too many rejects, then most likely a hack attempt.

# FIXME: Where is the call verification?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The verification happens only once during registration of the webhook in the Meta Business Suite

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still needs call verification. Anybody can call this endpoint.

Comment on lines +44 to +45
# FIXME: Handle multiple events in a single call, as it clearly implied by `changes`
# and `statuses` being a list in this call
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fixed.

funnel/views/api/whatsapp_events.py Show resolved Hide resolved
Comment on lines +276 to +279
# Send whatsapp message
def send_whatsapp(
self, flash_success: bool = True, flash_failure: bool = True
) -> whatsapp.WhatsappTemplate | None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a wrapping send_phone method that picks SMS or WhatsApp automatically — or both.

@jace jace marked this pull request as draft December 13, 2023 19:53
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.

2 participants