New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/ceccode/serverless-contact-service

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ceccode/serverless-contact-service

  • v0.0.0-20170102202741-82a0599e5f06
  • Source
  • Go
  • Socket score

Version published
Created
Source

Serverless contact service

Build Status Known Vulnerabilities https://david-dm.org/ceccode/serverless-contact-service.svg

API Gateway + AWS Lambda + AWS SES

The email function use the AWS SDK for Node.js to send an email using AWS Simple Email Service.

Usefull for:

  • Marketing websites
  • Product landing pages
  • Micro-sites
  • Team homepages

Install

  1. Setup your AWS Credentials
  2. Install Serverless.js
npm install -g serverless
  1. Clone the project:
git clone git@github.com:ceccode/serverless-contact-service.git
  1. Install dependencies
npm install

Configuration

  1. In your serverless.yml file set environment var:
  environment:
    EMAIL_SENDER: 'you-sender-address'
    EMAIL_RECEIVER: 'you-receiver-address'
    EMAIL_OBJECT: 'Referral Form'

This project use Amazon SES to send emails. For testing, it restricts the email addresses that can “send” and “receive” messages to ones that have been “verified”. Go to the SES page of the Console, choose Email Addresses > Verify New Email Address.

  1. Ad an usage plan to your api-key, see how here

Find the api-key name in your serverless.yml file:

  apiKeys:
    - contack-key   

Deploy

npm run deploy

Use

[POST] /contact

Headers

{
	"Content-Type": "application/json",
    "x-api-key": "spnbH7eO7Rgj1Kv6tJ7v9jKwvY6sPyL27eV8nYqb",
}

Body:

{
	"name": "Mario Rossi",
    "email": "mario.rossi@example.it",
	"message": "My message"
}

Test

Run all tests

npm test

Coverage

npm run test-travis

License

MIT license

FAQs

Package last updated on 02 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc