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 details)

Uploaded Source

Built Distribution

File details

Details for the file django-serverless-emailer-0.3.0.tar.gz.

File metadata

File hashes

Hashes for django-serverless-emailer-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2524052659b61b92f3fca55cab897b06a50cea11f3acd556dd555d6499c92f4e
MD5 eacafa74b3f8a10b2c7378cfe73e38f7
BLAKE2b-256 a27bad82f5872d864f1519470abea8fb714fd56f97620a1f06bf7f21da968fc3

See more details on using hashes here.

File details

Details for the file django_serverless_emailer-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_serverless_emailer-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f021bc406f8dc6918a4a69d6a90078b41bd3d2882cde0b66b2a02782778cbddb
MD5 9e8a650efcce44762c05868ae264bf02
BLAKE2b-256 7e1e081dfe46e98fd1b8d94d1d81c07da8909f16844e1c1723999bd5a7f640e1

See more details on using hashes here.

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