DocPad plugin to handle form submissions and mail out their content.
npm install docpad-plugin-formmail
|4||downloads in the last month|
|Version||2.0.2 last updated 5 months ago|
|Keywords||docpad, docpad-plugin, form, mail|
FormMail Plugin for DocPad
A simple DocPad plugin which extends the server to handle posts to a configurable url and deliver it's contents to email addresses with a configurable smtp account. The typical usage scenario is adding a contact form to your DocPad site.
npm install --save docpad-plugin-formmail
Configure the path to be intercepted on your server, the success redirect path and the email details for sending out form data in the DocPad configuration file. You can also enable Captcha form validation with additional configuration options. A full configuration entry would look similar to:
plugins: formmail: path: '/contact', redirect: '/thanks', transport: service: 'Gmail', auth: user: 'email@example.com', pass: 'password' to: 'firstname.lastname@example.org', captcha: image: '/captcha', redirect: '/tryagain', options: height: 150, width: 300
pathproperty should match the POST action on your site's form.
redirectproperty (optional) references a valid route to following successful submission (defaults to '/').
toproperty may be a list of destination email addresses for sending form submissions.
transportproperty configures an SMTP transport instance using nodemailer.
captcha -> imageproperty sets the path to retrieve captcha images, e.g
<img src="/captcha" />
captcha -> redirectproperty (optional) references a valid route to following failed Captcha validation (defaults to '/')
captcha -> optionsproperty sets options for generating images, as used by captchagen, such as image height and width.
You can discover the history inside the