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
Close
Hashes for django-serverless-emailer-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff5d05a0a88a31678bdc279b875ffded10f25e3dae945fc1588a6bd67831ab03 |
|
MD5 | f0954ad0a8f9f0b1b374479a72a6dae7 |
|
BLAKE2b-256 | 0b5732005805050ff8a3abeb6b13160cd9ecf1a2fe3610c26388cd32ced34200 |