Event driven example of sending an email with a mustache template in Nitric
Windows
Install with scoop
scoop bucket add nitric https://github.com/nitrictech/scoop-bucket.git
scoop install nitric
Linux
Download as a scripted install via curl.
curl https://nitric.io/install | bash
Note: Complete installation guide can be found here
mv env-template .env
AWS_SES_REGION="us-east-1"
AWS_SES_ACCESS_KEY_ID="..."
AWS_SES_SECRET_ACCESS_KEY="..."
SENDER_EMAIL="..."
SYS_ADMIN_EMAIL="..."
Note: You'll need to whitelist these emails with amazon to send emails
yarn install
nitric run
curl --location --request GET 'http://127.0.0.1:9001/apis/main/welcome/user'
{ "message": "Glad you're here developing with us - user." }
curl --location --request GET 'http://127.0.0.1:9001/apis/main/events'
{
"output": {
"documents": [
{
"ref": {
"documentClient": {},
"parent": {
"documentClient": {},
"name": "msg"
},
"id": "e9e18a55-6ed3-4781-b3f7-820ce221eb93"
},
"content": {
"id": "e9e18a55-6ed3-4781-b3f7-820ce221eb93",
"message": "Glad you're here developing with us - user.",
"timestamp": "1646942233037"
}
}
],
"pagingToken": null
}
}
Explore the Nitric framework to learn how to deploy to the cloud and much more.