Superstatic Forms
A simple service for capturing submitted forms via email.
Client Configuration
Superstatic Forms is configured by providing a JSON object with keys
named for a specific form and values as described below. For example,
your superstatic.json
might have a section like this:
This would allow a form with method POST
and action /__/forms/contact
to submit a contact email, and action /__/forms/beta
to submit a beta
signup email. For example:
Name: Email: Contact Us
Configuration Options
- to: (required) Email address of the recipient with optional name. This field cannot be dynamic.
- from: (required) Email address to mark the email as being sent from.
- replyTo: (optional) Reply-to address for easy follow-up.
- subject: (required) Subject of the email.
- html: (optional) HTML template for the email body.
- text: (optional) Plain text template for the email body.
- success: (required only if it's not an ajax request) Redirect URL on successful submission.
- failure: (required only if it's not an ajax request) Redirect URL on failure.
The subject
, replyTo
, html
, and text
fields are all rendered using Handlebars. If you don't supply html
or text
a simple list of the submitted form information will be added automatically.
Note: To prevent spam and other abuse, the to
address is only configurable in superstatic.json
. It is not templatable.
Server-Side
You must provide server-side global configuration so that Superstatic Forms is able to send email. This service uses nodemailer in the background, so configuration is based on that.
from: "no-reply@your-company.com" transport: 'SMTP' options: // ... ;