From 7f6fea68708ad7603f60425632d7b9b1f50fff96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Bregu=C5=82a?= Date: Thu, 3 Oct 2019 08:47:54 +0200 Subject: [PATCH] [AIRFLOW-XXX] Format Sendgrid docs (#6245) --- airflow/contrib/utils/sendgrid.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/airflow/contrib/utils/sendgrid.py b/airflow/contrib/utils/sendgrid.py index d90898c5019b5b..d81005706bfd0a 100644 --- a/airflow/contrib/utils/sendgrid.py +++ b/airflow/contrib/utils/sendgrid.py @@ -36,17 +36,23 @@ def send_email(to, subject, html_content, files=None, cc=None, bcc=None, sandbox_mode=False, **kwargs): """ - Send an email with html content using sendgrid. + Send an email with html content using `Sendgrid `__. To use this plugin: - 0. include sendgrid subpackage as part of your Airflow installation, e.g., - pip install 'apache-airflow[sendgrid]' - 1. update [email] backend in airflow.cfg, i.e., - [email] - email_backend = airflow.contrib.utils.sendgrid.send_email - 2. configure Sendgrid specific environment variables at all Airflow instances: - SENDGRID_MAIL_FROM={your-mail-from} - SENDGRID_API_KEY={your-sendgrid-api-key}. + + 0. Include ``sendgrid`` subpackage as part of your Airflow installation, e.g.,:: + + pip install 'apache-airflow[sendgrid]' + + 1. Update ``email_backend`` property in `[email]`` section in ``airflow.cfg``, i.e.,:: + + [email] + email_backend = airflow.contrib.utils.sendgrid.send_email + + 2. Configure Sendgrid specific environment variables at all Airflow instances::: + + SENDGRID_MAIL_FROM={your-mail-from} + SENDGRID_API_KEY={your-sendgrid-api-key}. """ if files is None: files = []