blob: e4f787854a096f0ae95727be42973c8c0b5d1269 [file] [log] [blame]
:py:mod:`airflow.operators.email`
=================================
.. py:module:: airflow.operators.email
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.operators.email.EmailOperator
.. py:class:: 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)
Bases: :py:obj:`airflow.models.BaseOperator`
Sends an email.
:param to: list of emails to send the email to. (templated)
:type to: list or string (comma or semicolon delimited)
:param subject: subject line for the email. (templated)
:type subject: str
:param html_content: content of the email, html markup
is allowed. (templated)
:type html_content: str
:param files: file names to attach in email (templated)
:type files: list
:param cc: list of recipients to be added in CC field
:type cc: list or string (comma or semicolon delimited)
:param bcc: list of recipients to be added in BCC field
:type bcc: list or string (comma or semicolon delimited)
:param mime_subtype: MIME sub content type
:type mime_subtype: str
:param mime_charset: character set parameter added to the Content-Type
header.
:type mime_charset: str
.. py:attribute:: template_fields
:annotation: = ['to', 'subject', 'html_content', 'files']
.. py:attribute:: template_fields_renderers
.. py:attribute:: template_ext
:annotation: = ['.html']
.. py:attribute:: ui_color
:annotation: = #e6faf9
.. py:method:: execute(self, context)
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.