All Projects → danielireson → Formplug Serverless

danielireson / Formplug Serverless

Licence: mit
Form forwarding service for AWS Lambda

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Formplug Serverless

Aws Lambda Typescript
This sample uses the Serverless Application Framework to implement an AWS Lambda function in TypeScript, deploy it via CloudFormation, publish it through API Gateway to a custom domain registered on Route53, and document it with Swagger.
Stars: ✭ 228 (-1.72%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless Sentry Plugin
This plugin adds automatic forwarding of errors and exceptions to Sentry (https://sentry.io) and Serverless (https://serverless.com)
Stars: ✭ 146 (-37.07%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless
Serverless 架构应用开发指南 - Serverless Architecture Application Development Guide with Serverless Framework.
Stars: ✭ 1,616 (+596.55%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless Docker Image Resize
Simple serverless image resize on-the-fly - Deploy with one command - Built with AWS Lambda and S3
Stars: ✭ 114 (-50.86%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless Chrome
🌐 Run headless Chrome/Chromium on AWS Lambda
Stars: ✭ 2,625 (+1031.47%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless Side Rendering React Next
Sample repo for setting up Next and React on AWS Lambda with the Serverless Framework.
Stars: ✭ 117 (-49.57%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless Sam
Serverless framework plugin to export AWS SAM templates for a service
Stars: ✭ 143 (-38.36%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Kinesis Streams Fan Out Kinesis Analytics
Amazon Kinesis Streams fan-out via Kinesis Analytics (powered by the Serverless Framework)
Stars: ✭ 95 (-59.05%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Retinal
🏙 Retinal is a Serverless AWS Lambda service for resizing images on-demand or event-triggered
Stars: ✭ 208 (-10.34%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Zappa
Serverless Python
Stars: ✭ 11,859 (+5011.64%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Awesome Layers
λ A curated list of awesome AWS Lambda Layers. Sponsored by https://cloudash.dev
Stars: ✭ 1,655 (+613.36%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless Aws Alias
Alias support for Serverless 1.x
Stars: ✭ 171 (-26.29%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless
⚡ Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more! –
Stars: ✭ 41,584 (+17824.14%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless Architectures Aws
The code repository for the Serverless Architectures on AWS book
Stars: ✭ 120 (-48.28%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless With Next5 Boilerplate
Serverless.js with Next.js 5 on AWS, powered by the Serverless Framework
Stars: ✭ 100 (-56.9%)
Mutual labels:  serverless, aws-lambda, serverless-framework
A Crash Course On Serverless Auth
A short and easy boilerplate showcasing JWT auth with Nodejs, the Serverless framework, MongoDB and AWS Lambda.
Stars: ✭ 127 (-45.26%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless Node Simple Messaging
Simple email AWS lambda function
Stars: ✭ 75 (-67.67%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless Plugin Git Variables
⚡️ Expose git variables to serverless
Stars: ✭ 75 (-67.67%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Serverless Next.js
⚡ Deploy your Next.js apps on AWS Lambda@Edge via Serverless Components
Stars: ✭ 2,977 (+1183.19%)
Mutual labels:  serverless, aws-lambda, serverless-framework
Cartoonify
Deploy and scale serverless machine learning app - in 4 steps.
Stars: ✭ 157 (-32.33%)
Mutual labels:  serverless, aws-lambda, serverless-framework

Formplug

Build Status

Formplug is a form forwarding service for AWS Lambda. Use it to accept form submissions by email without server-side code. It's built using the Serverless Framework and uses Amazon SES to send emails.

Usage

Basic

Set the form action to your deployed Formplug endpoint. Email addresses can be passed in plain text (as in the example below) or encrypted as a hexedecimal string (see encryption).

<form action="https://apigatewayurl.com" method="post">
    <input type="hidden" name="_to" value="[email protected]">
    <input type="text" name="message">
    <input type="submit" value="send">
</form>

Use a select if you want to change the recipient based on a user choice without using JavaScript.

<select name="_to">
  <option value="[email protected]">Recipient option 1</option>
  <option value="[email protected]">Recipient option 2</option>
</select>

Separate multiple email addresses by a semicolon.

<!-- plain text emails -->
<input type="hidden" name="_cc" value="[email protected];[email protected]">

<!-- encrypted emails -->
<input type="hidden" name="_cc" value="ff19d0abcd474813ad;c031a9b24855090b5e8b">

Special inputs

Name Description Multiple emails Required
_to Email address of the primary recipient. N Y
_cc Email addresses to receive a carbon copy. Y N
_bcc Email addresses to receive a blind carbon copy. Y N
_replyTo Email addresses to set as reply to addresses. Y N
_honeypot A spam prevention field that should be hidden for regular website users. The submission will be ignored if the the _honeypot input is present and not empty. / N
_recaptcha User token from Google reCaptcha v3. / N
_redirect A URL to redirect users to after a successful form submission. / N

AJAX

Append format=json to the query string to get responses back in JSON with a CORS allow all origin header.

<form action="https://apigatewayurl.com?format=json" method="post">
    <input type="hidden" name="_to" value="[email protected]">
    <input type="text" name="message">
    <input type="submit" value="send">
</form>

Spam prevention

Whitelisting

You can restrict where emails can be sent to by setting WHITELISTED_RECIPIENTS in config.json to an array of valid recipients. If this is not set then form submissions can be forwarded to any email address.

Honeypot

A honeypot field can be used as an easy to setup spam prevention measure. If the _honeypot input is not empty on a form submission then the request will be ignored. CSS should be used to hide the input from regular visitors.

<input type="text" name="_honeypot" value="" style="display:none">

reCaptcha

Google's reCaptcha v3 can be integrated for advanced spam prevention. This validates each form submission invisibly based on user interactions with your site. To setup, provide your site secret key in config.json as RECAPTCHA_SECRET_KEY and send the response token from execute as a _recaptcha field on each form submission.

<script src="https://www.google.com/recaptcha/api.js?render=RECAPTCHA_SECRET_KEY"></script>
<script>
grecaptcha.ready(function() {
    grecaptcha.execute('RECAPTCHA_SECRET_KEY').then(function(token) {
       // send token as _recaptcha with the rest of the form
       // this can be done by appending a hidden input to the form
       // or sending programatically using the Fetch API or similar
    });
});
</script>

Customisation

Create a HTML template at src/template/custom.html and this will be used instead of default.html.

Submission preview

Encryption

Email addresses can be encrypted so that they're not visible in the HTML source. Ensure ENCRYPTION_KEY in config.json is set to a random value as this is used to determine the encrypted values.

> npm run encrypt [email protected]
[email protected] => ff17d6a0cd474813adc031a9b24855090b5e8b
> npm run decrypt ff17d6a0cd474813adc031a9b24855090b5e8b
ff17d6a0cd474813adc031a9b24855090b5e8b => [email protected]

Setup

Install Serverless

Follow the Serverless Framework AWS installation.

Setup SES identity

Amazon SES can only send emails from addresses that you have verified ownership of. Verification can be done using the AWS Management Console by visiting the SES Dashboard and heading to Identity Management. AWS also puts new SES accounts under limits which prevent emails from being sent to email addresses that haven't been verified. Check out the relevant AWS SES documentation for more information. The limits can be lifted by opening a support ticket.

Install dependencies

Run npm install to get the NPM dependencies.

Add config

Create a copy of config.sample.json as config.json and edit as appropriate.

Name Description Required
SERVICE_NAME The private name for the service. Y
ENCRYPTION_KEY A random string used for encryption. Y
REGION The AWS region to deploy to (this should be either eu-west-1, us-east-1, or us-west-2 as these are the only SES supported regions). Y
STAGE The AWS stage to deploy to (it's common to use dev or prod). Y
SENDER_ARN The ARN of the sender email address. Y
MSG_RECEIVE_SUCCESS This is returned to the user on a successful form submission if a redirect URL isn't provided. N
MSG_SUBJECT The subject line to use in emails. N
WHITELISTED_RECIPIENTS Only allow emails to be sent to specific addresses. N
RECAPTCHA_SECRET_KEY Site secret key for reCaptcha v3. N

Deploy

Run serverless deploy to deploy to AWS.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].