airflow.providers.amazon.aws.operators.ses

Send email using Amazon Simple Email Service (SES).

Classes

SesEmailOperator

Send an email using Amazon Simple Email Service (SES).

Module Contents

class airflow.providers.amazon.aws.operators.ses.SesEmailOperator(*, mail_from, to, subject, html_content, files=None, cc=None, bcc=None, mime_subtype='mixed', mime_charset='utf-8', reply_to=None, return_path=None, custom_headers=None, **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.ses.SesHook]

Send an email using Amazon Simple Email Service (SES).

See also

For more information on how to use this operator, take a look at the guide: Send an email using Amazon SES

Parameters:
  • mail_from (str) – Email address to set as email’s from (templated)

  • to (str | collections.abc.Iterable[str]) – List of email addresses to set as email’s to (templated)

  • subject (str) – Email’s subject (templated)

  • html_content (str) – Content of email in HTML format (templated)

  • files (list[str] | None) – List of paths of files to be attached

  • cc (str | collections.abc.Iterable[str] | None) – List of email addresses to set as email’s CC (templated)

  • bcc (str | collections.abc.Iterable[str] | None) – List of email addresses to set as email’s BCC (templated)

  • mime_subtype (str) – Can be used to specify the subtype of the message. Default = mixed

  • mime_charset (str) – Email’s charset. Default = UTF-8

  • reply_to (str | None) – The email address to which replies will be sent

  • return_path (str | None) – The email address to which message bounces and complaints should be sent

  • custom_headers (dict[str, Any] | None) – Additional headers to add to the MIME message

  • aws_conn_id – The Airflow connection used for AWS credentials. If this is None or empty then the default boto3 behaviour is used. If running Airflow in a distributed manner and aws_conn_id is None or empty, then default boto3 configuration would be used (and must be maintained on each worker node).

  • region_name – AWS region_name. If not specified then the default boto3 behaviour is used.

  • verify – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html

  • botocore_config – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html

aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
template_fields_renderers[source]
mail_from[source]
to[source]
subject[source]
html_content[source]
files = None[source]
cc = None[source]
bcc = None[source]
mime_subtype = 'mixed'[source]
mime_charset = 'utf-8'[source]
reply_to = None[source]
return_path = None[source]
custom_headers = None[source]
execute(context)[source]

Send email using Amazon SES.

Parameters:

context (airflow.sdk.Context) – The task context

Returns:

Response from Amazon SES service with unique message identifier

Return type:

dict

Was this entry helpful?