notifications.py 764 B

12345678910111213141516171819
  1. import logging
  2. # Configure logging
  3. logging.basicConfig(level=logging.INFO)
  4. logger = logging.getLogger("notifications")
  5. def notify_status_change(email: str, order_id: int, new_status: str, first_name: str):
  6. """
  7. Hook to send notification when order status changes.
  8. The USER will configure SMTP here later.
  9. """
  10. logger.info(f"NOTIFICATION HOOK: Sending status update to {email} for Order #{order_id}. New Status: {new_status}")
  11. # Template for future SMTP integration:
  12. # subject = f"Radionica3D: Update on your Order #{order_id}"
  13. # body = f"Hello {first_name},\n\nYour order status has been updated to: {new_status}.\n\nCheck details here: http://localhost:5173/orders"
  14. # send_email(email, subject, body)
  15. return True