The Reusable Forms Customization Guide

When you download a form, the file "handler.php" already has a basic implementation ready for you. This guide explains how to customize handler.php.

See a video demo here

Update your email address to receive form submission emails

$pp->sendEmailTo(''); // ← Your email here

replace with your email address.

If you want to send email to more than one email addresses, just enter it as an array like so:

$pp->sendEmailTo(['', '','']); 

Adding Form Validations

Add your validations in the validate() function. You can add more validations as required. Examples:

$validator = $pp->getValidator();

Customizing PHPMailer

The FormHandler uses PHPMailer to send emails. You can customize the internal PHPMailer object like so:

$mailer = $pp->getMailer();

Using an SMTP account

You can customize PHPMailer to use an SMTP account too. The snippet below uses SMTP account from Amazon SES:

$mailer = $pp->getMailer();

//Using Aamazon AWS SES SMTP account
$mailer->SMTPAuth   = true; 
$mailer->SMTPSecure = "tls"; 
$mailer->Host       = "";
$mailer->Username   = "YOUR AWS SMTP CREDENTIALS";
$mailer->Password   = "YOUR AWS SMTP CREDENTIALS";

$mailer->setFrom('', 'Form');

See the PHPMailer Page for more customization options.

File Uploads

If you have file uploads in the form, just call attachFiles() with the name of the file input field to attach the file to the email.


where 'image' is the name of the file upload field


You can use Gregwar/Captcha to add captcha to your form. Call requireCaptcha() function so that the validation is triggered.


See some sample forms that use this captcha


Alternative to the image captcha, you can add ReCaptcha to the form as well. First you have to signup with reCaptcha and get your secret key.

Then Enable ReCaptcha and setup your secret Key.

$pp->getReCaptcha()->initSecretKey('Your ReCaptcha Secret Key Here');

You can download some recaptcha forms in this page.

Questions? post it here.