vdq.schedulers
Overview
Scheduling utilities for creating and queuing VDQ email and SMS queue items.
add_abstract_email
Create one email queue item per recipient across to, cc, and bcc, without scheduling them for sending. Raises ValueError if the sender or any recipient has no email address.
Signature
add_abstract_email(sender, to, subject, text, origin, html, cc, bcc, reply_to, attachments)
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| sender | vueda.vdq.models.BaseSender | yes | ||
| to | collections.abc.Sequence[vueda.vdq.models.BaseReceiver] | yes | ||
| subject | str | yes | ||
| text | str | yes | ||
| origin | vueda.vdq.models.QueueItemOrigin | None | no | None | |
| html | str | None | no | None | |
| cc | collections.abc.Sequence[vueda.vdq.models.BaseReceiver] | None | no | None | |
| bcc | collections.abc.Sequence[vueda.vdq.models.BaseReceiver] | None | no | None | |
| reply_to | collections.abc.Sequence[vueda.vdq.models.BaseReceiver] | None | no | None | |
| attachments | dict[str, dict[str, typing.Any]] | collections.abc.Sequence[vueda.vdq.models.AbstractQueueItemAttachment] | None | no | None |
Source
server/vueda/vdq/schedulers.py:111
add_email
Create one email queue item per recipient across to, cc, and bcc, and schedule sending after the transaction commits. Returns the created queue items.
Signature
add_email(sender, to, subject, text, origin, html, cc, bcc, reply_to, attachments)
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| sender | vueda.vdq.models.BaseSender | yes | ||
| to | collections.abc.Sequence[vueda.vdq.models.BaseReceiver] | yes | ||
| subject | str | yes | ||
| text | str | yes | ||
| origin | vueda.vdq.models.QueueItemOrigin | None | no | None | |
| html | str | None | no | None | |
| cc | collections.abc.Sequence[vueda.vdq.models.BaseReceiver] | None | no | None | |
| bcc | collections.abc.Sequence[vueda.vdq.models.BaseReceiver] | None | no | None | |
| reply_to | collections.abc.Sequence[vueda.vdq.models.BaseReceiver] | None | no | None | |
| attachments | dict[str, dict[str, typing.Any]] | collections.abc.Sequence[vueda.vdq.models.AnyMailQueueItemAttachment] | None | no | None |
Source
server/vueda/vdq/schedulers.py:151
add_sms
Create an SMS queue item and schedule sending after the transaction commits. Raises ValueError if either role has no cell phone number.
Signature
add_sms(sender, receiver, body)
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| sender | yes | |||
| receiver | yes | |||
| body | yes |
Source
server/vueda/vdq/schedulers.py:186
schedule_queue_item
Publish the send task once the current transaction commits. A broker failure at publish time moves the queue item to errored with the exception in result.
Signature
schedule_queue_item(queue_item)
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| queue_item | vueda.vdq.models.QueueItem | yes |
Source
server/vueda/vdq/schedulers.py:35
Source
server/vueda/vdq/schedulers.py