FormMailer is a service application emailing simple forms posted by users of a registered web site, freeing webmasters from the burden to write server-side scripts to implement email dispatching. By simple form I mean form data that can be represented in terms of flat name-value pairs of strings such as typical feedback or contact forms.
The following steps briefly describe the workflow using FormMailer Service:
- A FormMailer Service administrator (a.k.a. SuperAdmin) creates an account for webmaster to grant using the service.
- Webmaster registers his sites/forms with FormMailer Service. In return FormMailer Service generates a URL that webmaster uses to post the form.
- Webmaster designs the form in his web site, and uses the URL in previous step to submit the form.
- Webmaster also designs a success/failure page or message box in his site to handle the completion of form submission.
Form handling:
- Both x-domain Ajax and plain HTML <form> submission
- reCAPTCHA
- multiple email transports: SMTP, Amazon SES, Sendmail and Direct
Administration:
- Supports SSO, basic and login form based authentication
- multiple administrators per site form
- mobile friendly
- No need to refresh browser (F5) any more! - changes made by other administrators are pushed from server to browser automatically thanks to Socket.IO
Architecture:
Supports file or MongoDB as data repository. File is ideal for single server hosting. With replication-enabled MongoDB as data repo, a shared-nothing architecture can be achieved to build geographically redundant highly available web service.
Administration site is available at Heroku. Login as admin/admin
. Demo site is slightly customized to protect admin
account. Data is reset daily.
- Install Node.js.
- Download and expand FormMailer-service.zip from latest release.
- Set environment variable NODE_ENV to production.
- Go to expanded FormMailer-service directory and run
npm install
. - Run
node server.js
to launch application. - Go to http://localhost:3000 to access the admin site. Login as admin/admin.
- To change port, either modifing file /server.js or set env PORT before launching node.
- Change Configurations.
- Running Node as a service or setting up a front-end reverse proxy are beyond the scope of this document. It's easy to google a solution.
- Install Ruby.
- Install Compass by running
gem update --system;gem install compass
. - Install Node.js.
- Run
npm install -g yo
to intall Yeoman. - Clone git repo from https://github.com/abbr/FormMailerService.git. Alternatively, create/go to the folder where you want to install the application and Run
npm install form-mailer-service
. The application will be downloaded to subfolder node_modules/form-mailer-service. Move subfolder form-mailer-service to the final location and rename folder if need. - Go to application root and run
npm install
, followed bybower install
. - Launch the application in development mode by running
grunt serve
. To launch in production mode, rungrunt serve:dist
. - The launcher will open http://localhost:9000. Log in as admin/admin.
- To stop, enter Ctrl-C twice.
- Change Configurations.
Following configs are defined in /data/system.json and requires restarting Node for changes to take effect:
- emailTransport defines email settings. FormMailer uses Nodemailer to send email. For supported email transports and corresponding settings, see Nodemailer Readme. Only Direct and SMTP transports have been tested.
- authenticationSchemes defines authentication schemes for FormMailer Service Administration site. Supported authentication schemes are SSO (a.k.a reverse-proxy), form and basic. SSO can be chained to form or basic authentication to use them as fallback, thus authenticationSchemes is an array. When using SSO, the HTTP header name containing authenticated user name is defined in property userHeader. Unlike form or basic authentication, SSO doesn't use application defined password. However, it requires userHeader value matching one of the registered user names for authorization.
- repository defines data repository types. Supported types are file and mongodb. For mongodb, supply connection string in property connection_string and connection options in connection_options.
See wiki