Skip to main content

Module email_deliveries

Module email_deliveries 

Source

Structsยง

CheckUserAndTemplateRow ๐Ÿ”’
Email
EmailDelivery
EmailDeliveryError
EmailDeliveryErrorInsert
EmailSendStatusFacts
The delivery-row facts derive_email_send_status needs, so the derivation itself is pure.
EmailSendStatusReport
The shared payload for every surface that reports on a queued email.

Enumsยง

EmailSendStatus
What we can honestly say about an email we queued.

Constantsยง

FETCH_LIMIT
PURGE_CHANCE_IN ๐Ÿ”’
One purge in this many calls, matching the token cleanups. The caller schedules how often it asks.
RECIPIENT_ADDRESS_RETENTION ๐Ÿ”’
How long a delivery to a raw address may keep that address after being queued.
RETRY_WINDOW_SECS
How long a delivery keeps being retried after its first failure.

Functionsยง

derive_email_send_status
The one derivation of send status. Every surface goes through it.
fetch_emails
get_send_status
get_send_statuses
increment_retry_and_mark_non_retryable
increment_retry_and_schedule
insert_email_delivery
Inserts an email delivery; fails if the user or email template is soft-deleted.
insert_email_delivery_error
insert_email_delivery_to_address
Queues an email to a raw address, for recipients who may have no account here.
mark_as_sent
maybe_purge_expired_recipient_addresses
Probabilistic purge instead of a cron, in the style of the token cleanups.
soft_delete_unsent_retryable_deliveries_for_user
Soft-deletes unsent, still-retryable email deliveries for a user. Call when soft-deleting the user so pending deliveries are not retried.