Lambda function to send form emails using NOW & MAILGUN
-
copy
now.json.example
asnow.json
then replace with your settings. -
set now.sh secrets:
now secrets add mailgun_api_key "YOU_MAILGUN_API_KEY"
now secrets add mailgun_domain "YOUR_MAILGUN_DOMAIN"
now secrets add mailgun_recipient "YOUR_EMAIL_ADDRESS"
now secrets add mailgun_sender "NOREPLY_ADDRESS"
- deploy to now with
npm run now-deploy
URL: /
Method: POST
Auth required: NO
Permissions required: None
Data example (all fields must be sent):
{
"name": "John Doe",
"email": "[email protected]",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
}