Serverless functions to deliver email sent from a website's contact form.
- NodeJS 6+
- Serverless
- Google Cloud Platform Account
These functions have been built using the Serverless Framework.
# 1. Install serverless globally
$ npm install -g serverless
# 2. Install the project's dependencies
$ npm install
In order to use these functions you have to create a Google Cloud Platform account as explained here: https://serverless.com/framework/docs/providers/google/guide/credentials/
Then configure your service using the config.json.sample
file supplied:
# Rename the configuration file
$ mv config.json.sample config.json
# Fill the config file with your data.
# Read https://developers.google.com/gmail/api/quickstart/nodejs to know how to get the required data.
$ vi config.json
Once your Google Cloud Platform account is setup, you can deploy your functions to production:
$ npm run deploy
In order to see information about your deployed service you can run:
$ npm run info
If you want to test your functions you can run:
# Check Google Cloud Functions status
$ npm run call -- ping
# Check your email provider status
$ npm run call -- check
# Send an email using your email provider.
$ npm run call -- contact --data '{"name":"Jane Doe","email":"[email protected]","message":"Hello World!"}'
And to see your functions logs you can run:
# Display check function logs
$ npm run logs -- check
# Display contact function logs
$ npm run logs -- contact
Email: info[@]adabits[.]org
Twitter: @adab1ts
Facebook: Adab1ts
LinkedIn: adab1ts
Designed, developed and maintained by
Klaudia Alvarez | Carles Muiños |
The code of this app is © 2018 Adab1ts under the terms of the MIT License.