Skip to main content

Provides a lambda handler for sending emails concerning errors in AWS

Project description

Currently only supports failed step functions. This is half-baked so far

Usage

# settings.py

INSTALLED_APPS = [
  "django_serverless_emailer",
  # ...
]

AWS_REGION = "us-west-2"  # your region

DEFAULT_FROM_EMAIL = "an-email@email.com"  # your sender
EMAIL_HOST = "smtp.gmail.com"  # your host
EMAIL_PORT = 465  # your port
EMAIL_HOST_USER = "an-email@email.com"  # your user
EMAIL_HOST_PASSWORD = os.getenv["EMAIL_PASSWORD"]
EMAIL_USE_SSL = True  # if you're using SSL

EMAIL_RECEPIENTS = "a@b.com,c@d.com"  # comma delimited list or a plain list
# serverless.yml

functions:
  notify:
    handler: path/to/handler.send_email
    description: Send an email
    layers:
      - { Ref: PythonRequirementsLambdaLayer }
# handler.py

import django
import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "setup.settings")
django.setup()

from django_serverless_emailer import notify


def send_email(event, _):
    notify(event, _)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-serverless-emailer-0.3.0.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

django_serverless_emailer-0.3.0-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page