care.utils.sms.backend.base module

class SmsBackendBase(fail_silently: bool = False, **kwargs)

Bases: object

Base class for all SMS backends.

Subclasses should override the send_message method to provide the logic for sending SMS messages.

__init__(fail_silently: bool = False, **kwargs) None

Initialize the SMS backend.

Parameters:
  • fail_silently (bool) – Whether to suppress exceptions during message sending. Defaults to False.

  • **kwargs – Additional arguments for backend configuration.

send_message(message: TextMessage) int

Send a text message.

Subclasses must implement this method to handle the logic for sending messages using the specific backend.

Parameters:

message (TextMessage) – The message to be sent.

Raises:

NotImplementedError – If the method is not implemented in a subclass.

Returns:

The number of messages successfully sent.

Return type:

int