Skip to content

Serverless functions to deliver email sent from a website's contact form

License

Notifications You must be signed in to change notification settings

adab1ts/email-delivery-faas

Repository files navigation

Email Delivery FaaS

license

Serverless functions to deliver email sent from a website's contact form.

Requirements

  • NodeJS 6+
  • Serverless
  • Google Cloud Platform Account

Setup

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

Deploy

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

Test

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

Contact

Email: info[@]adabits[.]org
Twitter: @adab1ts
Facebook: Adab1ts
LinkedIn: adab1ts

Contributors

Designed, developed and maintained by

laklau zuzust
Klaudia Alvarez Carles Muiños

License

The code of this app is © 2018 Adab1ts under the terms of the MIT License.

About

Serverless functions to deliver email sent from a website's contact form

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published