Facebook Messenger notify component: add support for sending messages to specific page user IDs (#9643)

This commit is contained in:
Michel Weimerskirch 2017-10-02 11:29:31 +02:00 committed by Fabian Affolter
parent f7609e9cb1
commit 3337107e79

View File

@ -56,8 +56,15 @@ class FacebookNotificationService(BaseNotificationService):
return
for target in targets:
# If the target starts with a "+", we suppose it's a phone number,
# otherwise it's a user id.
if target.startswith('+'):
recipient = {"phone_number": target}
else:
recipient = {"id": target}
body = {
"recipient": {"phone_number": target},
"recipient": recipient,
"message": body_message
}
import json