core.sms_processor
Send SMS through ASPSMS
Adapted from `repoze.sendmail<https://github.com/repoze/repoze.sendmail>`_.
- Usage::
qp = SmsQueueProcessor(sms_directory) qp.send_messages()
Attributes
Classes
Functions
|
Module Contents
- class core.sms_processor.SmsQueueProcessor(path: str, username: str, password: str, originator: str | None = None)[source]
-
- split(filename: str) tuple[str, str, str] [source]
Returns the path, the name and the suffix of the given path.
- message_files() tuple[str, Ellipsis] [source]
Returns a tuple of full paths that need processing.
The file names in the directory usually look like this:
0.1571822840.745629
1.1571822743.595377
The part before the first dot is the batch number the rest is the timestamp at time of calling app.send_sms.
The messages are sorted by suffix, so by default the sorting happens from oldest to newest message.
- send(numbers: Sequence[str], content: str) dict[str, Any] | None [source]
Sends the SMS and returns the API response on error.
On success this returns None.
- core.sms_processor.get_sms_queue_processor(app: onegov.core.framework.Framework, missing_path_ok: bool = False) SmsQueueProcessor | None [source]