workflows.services.executors.email

Email step executor.

Classes

EmailParts

Internal container for resolved email components.

EmailExecutor

Send an email using either a named template or a simple subject/body.

Module Contents

class workflows.services.executors.email.EmailParts[source]

Internal container for resolved email components.

to: tuple[str, Ellipsis][source]
cc: tuple[str, Ellipsis][source]
bcc: tuple[str, Ellipsis][source]
from_email: str | None[source]
template_ctx: dict[str, Any][source]
dj: Any[source]
class workflows.services.executors.email.EmailExecutor[source]

Bases: workflows.services.executors.factory.AbstractStepExecutor

Send an email using either a named template or a simple subject/body.

do_execute(instance, _signal)[source]

Execute the email step.

Parameters:
Returns:

ExecutorResult describing the outcome of sending the email.

Return type:

workflows.services.types.ExecutorResult

static _prepare_recipients_and_context(params, instance)[source]

Prepare normalized recipients and template context.

Parameters:
Return type:

EmailParts

static _error_result(message, *, outputs=None)[source]

Return a standardized FAILED result for this email step.

Parameters:
  • message (str) – Human-readable error description.

  • outputs (dict[str, Any] | None) – Optional additional output fields to include in the context.

Returns:

ExecutorResult with FAILED state and error details.

Return type:

workflows.services.types.ExecutorResult

_send_template_email(params, template_key, parts)[source]

Handle template-based email sending.

Parameters:
  • params (dict[str, Any])

  • template_key (str)

  • parts (EmailParts)

Return type:

workflows.services.types.ExecutorResult

_send_custom_email(params, parts)[source]

Handle plain-text email sending.

Parameters:
Return type:

workflows.services.types.ExecutorResult