care.utils.sms.utils module¶
- initialize_backend(backend_name: str | None = None, fail_silently: bool = False, **kwargs) SmsBackendBase ¶
Load and configure an SMS backend.
- Parameters:
- Returns:
An initialized instance of the specified SMS backend.
- Return type:
- send_text_message(content: str = '', sender: str | None = None, recipients: str | list[str] | None = None, fail_silently: bool = False, backend_instance: type[SmsBackendBase] | None = None) int ¶
Send a single SMS message to one or more recipients.
- Parameters:
content (str) – The message content to be sent. Defaults to an empty string.
sender (Optional[str]) – The sender’s phone number. Defaults to None.
recipients (Union[str, List[str], None]) – A single recipient or a list of recipients. Defaults to None.
fail_silently (bool) – Whether to suppress exceptions during sending. Defaults to False.
backend_instance (Optional[SmsBackendBase]) – A pre-configured SMS backend instance. Defaults to None.
- Returns:
The number of messages successfully sent.
- Return type:
- get_sms_backend(backend_name: str | None = None, fail_silently: bool = False, **kwargs) SmsBackendBase ¶
Load and return an SMS backend instance.
- Parameters:
- Returns:
An initialized instance of the specified SMS backend.
- Return type: