ragV98 commited on
Commit
ac073c2
·
1 Parent(s): 5c882f9

changes destination

Browse files
components/gateways/headlines_to_wa.py CHANGED
@@ -60,7 +60,7 @@ def fetch_cached_headlines() -> str:
60
  return "\n".join(message_parts)
61
 
62
  # 📤 Send via Gupshup WhatsApp API
63
- def send_to_whatsapp(message_text: str) -> dict: # Function expects the full message text
64
  # Validate critical environment variables for sending a message
65
  if not WHATSAPP_TOKEN or \
66
  not WHATSAPP_TO_NUMBER or \
@@ -84,7 +84,7 @@ def send_to_whatsapp(message_text: str) -> dict: # Function expects the full mes
84
  payload = {
85
  "channel": "whatsapp",
86
  "source": GUPSHUP_SOURCE_NUMBER,
87
- "destination": WHATSAPP_TO_NUMBER,
88
  "src.name": GUPSHUP_APP_NAME,
89
  "message": json.dumps(whatsapp_message_content) # 'message' parameter with JSON string for text type
90
  }
 
60
  return "\n".join(message_parts)
61
 
62
  # 📤 Send via Gupshup WhatsApp API
63
+ def send_to_whatsapp(message_text: str, destination_number: str) -> dict: # Function expects the full message text
64
  # Validate critical environment variables for sending a message
65
  if not WHATSAPP_TOKEN or \
66
  not WHATSAPP_TO_NUMBER or \
 
84
  payload = {
85
  "channel": "whatsapp",
86
  "source": GUPSHUP_SOURCE_NUMBER,
87
+ "destination": destination_number,
88
  "src.name": GUPSHUP_APP_NAME,
89
  "message": json.dumps(whatsapp_message_content) # 'message' parameter with JSON string for text type
90
  }