Add a Contact Form

The form feature in Pulse allows you to easily create and customize a simple form for your website. To get started add this code to any page:

{{form}}

Now you will see the default form on your page. To further customize it, open config.php and edit the following settings.


$mail_inputs      = array('Name'=>'text','Email'=>'email','Phone'=>'text');
$lang_form_name   = 'Name';
$lang_form_email  = 'Email';
$mail_textarea    = array('Comment'=>'7');
$email_contact    = array('you@mail.com','another@mail.com');

The  $mail_inputs array contains all the text inputs that will be displayed. The default set is, Name, Email, Phone. The first two (Name & Email) are required. Anything after that is optional and you can add or remove as much as you want.

The  $lang_form_name and $lang_form_email variables let you change the labels of those required inputs if your language is not english.

The  $mail_textarea variable lets you set the name for the textarea label (default is Comment). It also sets the size by rows, the default is 7.

The last item you need to edit is the  $email_contact. This tells Pulse where to send the emails to. You can set one or multiple addresses.


SMTP Support

If you want to set this function to use SMTP, then it's really easy to do that. Edit inc/tags/form.php and you will see a section commented out.

// If your host requires smtp authentication, uncomment and fill out the lines below.
/*   
	
	$mail->isSMTP();                           // Do nothing here   
	$mail->Host = 'smtp1.example.com';         // Specify main server
	$mail->SMTPAuth = true;                    // Do nothing here
	$mail->Username = 'jswan';                 // SMTP username
	$mail->Password = 'secret';                // SMTP password
	$mail->Port = 465;                         // SMTP port
	$mail->SMTPSecure = 'tls';                 // Enable encryption, 'ssl' also accepted

*/

Uncomment this and fill it out to enable it.


Redirect on form success

Sometimes you may want to redirect to another page after form successfully completed.

1) Make a new file in tags called "redirect.php"
2) In that file add:
<?php
if(isset($_POST['submit'])){
//  To redirect form on a particular page
header("Location:https://www.yoursite.com/thankyou.html");
}
	
// Change this part from above to your "success page" absolute URL 

https://www.yoursite.com/thankyou.html

3) Change line 72 in form.php to:

<form id="contact" method="post" action="inc/tags/redirect.php" >
	

Email reply receipts

As of Pulse 4.7, you can now automatically send out a "thank you" email to people who complete your Pulse contact form. 

In the config.php "form" settings ensure this is "true" (default):

$config_contact_form_auto_thank = true; // Toggle "false" to disable auto thank you emails
	

To change the message, change the text in the language files. This will also send the email from the default user set in config.php.


For more complex forms

The Form Builder app (included in  Pulse Dashboard Accounts - Just Forms) is an easy drag and drop way to make more sophisticated multi-page interactive forms, questionnaires, registrations forms and surveys with form logic, stats, submission entries and notifications. 

It's an online tool so it keeps your Pulse install light and fast whilst adding more power and options should you need it. 

To embed the forms into your Pulse pages just copy and paste the embed code and that's it. 

Save and preview and your form will appear. Make changes from the Pulse Dashboard and they will appear automatically in your Pulse site. 

And from Pulse 4.7, use the {{justforms:formid:height}} tag for even easier embeds!

Easy, simple and secure forms for Pulse CMS.

Still need help? Contact Us Contact Us