Update app.py
Browse files
app.py
CHANGED
|
@@ -363,20 +363,20 @@ async def task_update(request: Request):
|
|
| 363 |
send_whatsapp_notification(chat_id, user_message)
|
| 364 |
|
| 365 |
for manager in manager_entries:
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
|
| 381 |
else:
|
| 382 |
print("❌ Failed to fetch notify data:", response.status_code)
|
|
|
|
| 363 |
send_whatsapp_notification(chat_id, user_message)
|
| 364 |
|
| 365 |
for manager in manager_entries:
|
| 366 |
+
manager_name = manager.get("name", "مدير غير معروف")
|
| 367 |
+
manager_number = manager.get("number")
|
| 368 |
+
if manager_number:
|
| 369 |
+
chat_id = f"{manager_number}@c.us"
|
| 370 |
+
personalized_message = (
|
| 371 |
+
f"📣 *تنبيه مهم:*\n\n"
|
| 372 |
+
f"📌 مرحباً {manager_name}\n"
|
| 373 |
+
f"📌 *الموظف:* {assignee_name_str}\n"
|
| 374 |
+
f"❌ *تأخر في مهمة:* {task_name}\n"
|
| 375 |
+
f"📅 *تاريخ التسليم:* {due_date}\n"
|
| 376 |
+
f"🔗 *رابط المهمة:* {task_url}\n\n"
|
| 377 |
+
f"يرجى المتابعة مع الفريق."
|
| 378 |
+
)
|
| 379 |
+
send_whatsapp_notification(chat_id, personalized_message)
|
| 380 |
|
| 381 |
else:
|
| 382 |
print("❌ Failed to fetch notify data:", response.status_code)
|