**Contact** is a super basic Node.js application that enables you to send email forms with minimal configuration. All form configuration is done in your HTML.
This project is, in some way, a clone of an excellent free service: [Formspree.io](https://formspree.io/). Although Formspree is outstanding, it might **not** be the best option for everyone; 2 key factors drove me to create this clone:
Formspree is opensource, and its code is on GitHub, but the setup process is way more than a trivial task, not to mention the requirements. Requirement 1 not met.
**Contact** uses `NODE_ENV` environment variable for loading its JSON configuration files, this allows you to override the above settings with other JSON files, for example, `config/production.json`.
Your form's action should point to your **contact** server using a valid email address (defined in the YAML file). If the email address is not in the whitelist, the email will not be sent.
- **\_from**: _Required_. This is usually the email address of the user submitting the email form. It will be used as the Form field.
- **\_subject**: _Optional_. The email subject.
- **\_info**: _Optional_. This text will be included in the email body before the values. Useful for providing some context in the email body.
- **\_attachment**: _Optional_. A file can be attached to the email form using this for the name of an `<input type="file"/>`. When sending attachments do not forget to include `enctype="multipart/form-data"` in your form tag.
- **\_next**: _Optional_. A URL to redirect the user once the form was submitted successfully.
- **\_fake**: _For testing_. If `true`, the email will not be sent and instead a JSON payload will be shown. Useful when testing the form with a REST client.
All other form fields will be sent by title casing the name. For example `<input type="text" name="first_name" />` will be displayed in the email as "First Name:"