From commits-return-11952-archive-asf-public=cust-asf.ponee.io@airflow.incubator.apache.org Wed Jan 10 19:39:15 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id E838818072F for ; Wed, 10 Jan 2018 19:39:15 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D7BF1160C2E; Wed, 10 Jan 2018 18:39:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 25F6C160C1E for ; Wed, 10 Jan 2018 19:39:14 +0100 (CET) Received: (qmail 66774 invoked by uid 500); 10 Jan 2018 18:39:14 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 66758 invoked by uid 99); 10 Jan 2018 18:39:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jan 2018 18:39:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C1A591A0AF4 for ; Wed, 10 Jan 2018 18:39:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.231 X-Spam-Level: X-Spam-Status: No, score=-4.231 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id ZGdYc0LPhIW5 for ; Wed, 10 Jan 2018 18:39:11 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id D49F05F250 for ; Wed, 10 Jan 2018 18:39:10 +0000 (UTC) Received: (qmail 66711 invoked by uid 99); 10 Jan 2018 18:39:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jan 2018 18:39:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EE0C2DFB0D; Wed, 10 Jan 2018 18:39:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: criccomini@apache.org To: commits@airflow.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-airflow git commit: [AIRFLOW-1958] Add **kwargs to send_email Date: Wed, 10 Jan 2018 18:39:09 +0000 (UTC) Repository: incubator-airflow Updated Branches: refs/heads/master ffc4a8b41 -> 97680d85f [AIRFLOW-1958] Add **kwargs to send_email Closes #2908 from ms32035/email_kwargs Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/97680d85 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/97680d85 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/97680d85 Branch: refs/heads/master Commit: 97680d85f4cf035affe680e4dde63ef1ecd8380f Parents: ffc4a8b Author: Marcin Szymanski Authored: Wed Jan 10 10:39:03 2018 -0800 Committer: Chris Riccomini Committed: Wed Jan 10 10:39:03 2018 -0800 ---------------------------------------------------------------------- airflow/contrib/utils/sendgrid.py | 4 +++- airflow/utils/email.py | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/97680d85/airflow/contrib/utils/sendgrid.py ---------------------------------------------------------------------- diff --git a/airflow/contrib/utils/sendgrid.py b/airflow/contrib/utils/sendgrid.py index 7e83df1..f7af087 100644 --- a/airflow/contrib/utils/sendgrid.py +++ b/airflow/contrib/utils/sendgrid.py @@ -27,7 +27,9 @@ from airflow.utils.log.logging_mixin import LoggingMixin 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. http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/97680d85/airflow/utils/email.py ---------------------------------------------------------------------- diff --git a/airflow/utils/email.py b/airflow/utils/email.py index fadd4d5..4ecba8f 100644 --- a/airflow/utils/email.py +++ b/airflow/utils/email.py @@ -34,17 +34,23 @@ from airflow.exceptions import AirflowConfigException 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