airflow.operators.email

Module Contents

Classes

EmailOperator

Sends an email.

class airflow.operators.email.EmailOperator(*, to: Union[List[str], str], subject: str, html_content: str, files: Optional[List] = None, cc: Optional[Union[List[str], str]] = None, bcc: Optional[Union[List[str], str]] = None, mime_subtype: str = 'mixed', mime_charset: str = 'utf-8', conn_id: Optional[str] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Sends an email.

Parameters
  • to (list or string (comma or semicolon delimited)) – list of emails to send the email to. (templated)

  • subject (str) – subject line for the email. (templated)

  • html_content (str) – content of the email, html markup is allowed. (templated)

  • files (list) – file names to attach in email (templated)

  • cc (list or string (comma or semicolon delimited)) – list of recipients to be added in CC field

  • bcc (list or string (comma or semicolon delimited)) – list of recipients to be added in BCC field

  • mime_subtype (str) – MIME sub content type

  • mime_charset (str) – character set parameter added to the Content-Type header.

template_fields = ['to', 'subject', 'html_content', 'files'][source]
template_fields_renderers[source]
template_ext = ['.html'][source]
ui_color = #e6faf9[source]
execute(self, context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?