feat: add durable mail delivery outbox
This commit is contained in:
@@ -511,6 +511,32 @@ class MailCampaignCapability:
|
||||
append_campaign_message_to_sent = staticmethod(append_campaign_message_to_sent)
|
||||
wait_for_rate_limit = staticmethod(wait_for_rate_limit)
|
||||
|
||||
@staticmethod
|
||||
def submit_delivery_command(session: Session, **kwargs: Any) -> dict[str, object]:
|
||||
from govoplan_mail.backend.delivery_outbox import submit_delivery_command
|
||||
|
||||
return submit_delivery_command(session, **kwargs)
|
||||
|
||||
@staticmethod
|
||||
def delivery_command_summary(
|
||||
session: Session,
|
||||
*,
|
||||
tenant_id: str,
|
||||
command_id: str,
|
||||
) -> dict[str, object]:
|
||||
from govoplan_mail.backend.delivery_outbox import (
|
||||
delivery_command_summary,
|
||||
get_delivery_command,
|
||||
)
|
||||
|
||||
return delivery_command_summary(
|
||||
get_delivery_command(
|
||||
session,
|
||||
tenant_id=tenant_id,
|
||||
command_id=command_id,
|
||||
)
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def mock_mailbox():
|
||||
from govoplan_mail.backend.dev import mock_mailbox
|
||||
@@ -521,3 +547,10 @@ class MailCampaignCapability:
|
||||
def campaign_capability(context: ModuleContext) -> MailCampaignCapability:
|
||||
configure_runtime(settings=context.settings)
|
||||
return MailCampaignCapability()
|
||||
|
||||
|
||||
def delivery_outbox_capability(context: ModuleContext):
|
||||
from govoplan_mail.backend.delivery_outbox import MailDeliveryOutboxCapability
|
||||
|
||||
configure_runtime(settings=context.settings)
|
||||
return MailDeliveryOutboxCapability()
|
||||
|
||||
Reference in New Issue
Block a user