Uses Zappa to deploy a serverless endpoint that receives a JSON and sends an email to a destination address. Made to support contact forms in our static website.
Before you begin, make sure you have a valid AWS account and your AWS credentials file is properly installed.
Make sure you are in a virtualenv, and run:
$ pip install -r requirements.txt
$ zappa deploy dev
To redeploy:
$ zappa update dev
To deploy the production version:
$ zappa deploy prod
In the zappa_settings.json
file, you can edit the environment variables for dev
and prod
:
{
"dev": {
...
"environment_variables": {
"FROM_EMAIL": "alan@tryolabs.com",
"DESTINATION_EMAIL": "alan@tryolabs.com"
}
},
...
}
With httpie, invoke the endpoint0 with the message.json
test file as payload:
$ http <endpoint> < message.json
Copyright (c) 2016 Tryolabs.
Released under the MIT License (See LICENSE).