|
2 | 2 | from os.path import join, dirname
|
3 | 3 | from dotenv import load_dotenv
|
4 | 4 |
|
5 |
| -dotenv_path = join(dirname(__file__), "../../.env") |
| 5 | +dotenv_path = join(dirname(__file__), "../../../.env") |
6 | 6 | load_dotenv(dotenv_path)
|
7 | 7 |
|
8 | 8 | VONAGE_APPLICATION_ID = os.environ.get("VONAGE_APPLICATION_ID")
|
9 | 9 | VONAGE_PRIVATE_KEY = os.environ.get("VONAGE_PRIVATE_KEY")
|
10 | 10 |
|
11 |
| -MESSAGES_SANDBOX_URL = os.environ.get("MESSAGES_SANDBOX_URL") |
12 |
| -MESSAGES_SANDBOX_FB_ID = os.environ.get("MESSAGES_SANDBOX_FB_ID") |
13 |
| -MESSAGES_SANDBOX_ALLOW_LISTED_FB_RECIPIENT_ID = os.environ.get( |
14 |
| - "MESSAGES_SANDBOX_ALLOW_LISTED_FB_RECIPIENT_ID" |
15 |
| -) |
| 11 | +MESSAGES_SANDBOX_HOST = os.environ.get("MESSAGES_SANDBOX_HOST") |
| 12 | +MESSENGER_RECIPIENT_ID = os.environ.get("MESSENGER_RECIPIENT_ID") |
| 13 | +MESSENGER_SENDER_ID = os.environ.get("MESSENGER_SENDER_ID") |
16 | 14 |
|
17 | 15 | from vonage import Auth, HttpClientOptions, Vonage
|
18 | 16 | from vonage_messages import MessengerText
|
|
22 | 20 | application_id=VONAGE_APPLICATION_ID,
|
23 | 21 | private_key=VONAGE_PRIVATE_KEY,
|
24 | 22 | ),
|
25 |
| - http_client_options=HttpClientOptions(api_host=MESSAGES_SANDBOX_URL), |
| 23 | + http_client_options=HttpClientOptions(api_host=MESSAGES_SANDBOX_HOST), |
26 | 24 | )
|
27 | 25 |
|
28 | 26 | message = MessengerText(
|
29 |
| - to=MESSAGES_SANDBOX_ALLOW_LISTED_FB_RECIPIENT_ID, |
30 |
| - from_=MESSAGES_SANDBOX_FB_ID, |
| 27 | + to=MESSENGER_RECIPIENT_ID, |
| 28 | + from_=MESSENGER_SENDER_ID, |
31 | 29 | text="This is a Facebook Messenger text message sent using the Vonage Messages API via the Messages Sandbox",
|
32 | 30 | )
|
33 | 31 |
|
|
0 commit comments