From 88dff651b7fd3cd6bec75bc0ff4c070e7e235d4f Mon Sep 17 00:00:00 2001 From: Marcin Szymanski Date: Fri, 29 Dec 2017 20:24:23 +0100 Subject: [PATCH] [AIRFLOW-1958] Add **kwargs to send_email --- airflow/contrib/utils/sendgrid.py | 4 +++- airflow/utils/email.py | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/airflow/contrib/utils/sendgrid.py b/airflow/contrib/utils/sendgrid.py index 7e83df12a34f8..f7af08720308a 100644 --- a/airflow/contrib/utils/sendgrid.py +++ b/airflow/contrib/utils/sendgrid.py @@ -27,7 +27,9 @@ from sendgrid.helpers.mail import Attachment, Content, Email, Mail, Personalization -def send_email(to, subject, html_content, files=None, dryrun=False, cc=None, bcc=None, mime_subtype='mixed'): +def send_email(to, subject, html_content, files=None, + dryrun=False, cc=None, bcc=None, + mime_subtype='mixed', **kwargs): """ Send an email with html content using sendgrid. diff --git a/airflow/utils/email.py b/airflow/utils/email.py index fadd4d51ff9ae..4ecba8f69b74a 100644 --- a/airflow/utils/email.py +++ b/airflow/utils/email.py @@ -34,17 +34,23 @@ from airflow.utils.log.logging_mixin import LoggingMixin -def send_email(to, subject, html_content, files=None, dryrun=False, cc=None, bcc=None, mime_subtype='mixed'): +def send_email(to, subject, html_content, files=None, + dryrun=False, cc=None, bcc=None, + mime_subtype='mixed', **kwargs): """ Send email using backend specified in EMAIL_BACKEND. """ path, attr = configuration.get('email', 'EMAIL_BACKEND').rsplit('.', 1) module = importlib.import_module(path) backend = getattr(module, attr) - return backend(to, subject, html_content, files=files, dryrun=dryrun, cc=cc, bcc=bcc, mime_subtype=mime_subtype) + return backend(to, subject, html_content, files=files, + dryrun=dryrun, cc=cc, bcc=bcc, + mime_subtype=mime_subtype, **kwargs) -def send_email_smtp(to, subject, html_content, files=None, dryrun=False, cc=None, bcc=None, mime_subtype='mixed'): +def send_email_smtp(to, subject, html_content, files=None, + dryrun=False, cc=None, bcc=None, + mime_subtype='mixed', **kwargs): """ Send an email with html content