35 lines
906 B
Python
35 lines
906 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Dict, Any, Optional
|
|
|
|
class BaseProvider(ABC):
|
|
"""Base class for WhatsApp messaging providers"""
|
|
|
|
@abstractmethod
|
|
def send_message(
|
|
self,
|
|
to: str,
|
|
template_name: Optional[str],
|
|
template_body: str,
|
|
variables: Dict[str, str],
|
|
language: str = "en"
|
|
) -> str:
|
|
"""
|
|
Send a WhatsApp message.
|
|
|
|
Args:
|
|
to: Phone number in E.164 format
|
|
template_name: WhatsApp template name (if using approved template)
|
|
template_body: Message body text
|
|
variables: Variables to substitute in template
|
|
language: Language code
|
|
|
|
Returns:
|
|
Provider message ID
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_provider_name(self) -> str:
|
|
"""Get provider name"""
|
|
pass
|