Contact form plugin for CakePHP
This plugin gives you a basic contact form that sends the contact info to you by email, and also stores it in the database in case the email gets lost.
After sending and storing the contact info it redirects to a thanks page on which you can put a Google Analytics tracker if you wish to follow AdWords conversion goals.
Installation
Clone
In your
plugins folder typegit clone git://github.com/msadouni/cakephp-contact-plugin.git contact
Submodule
In your root folder type
git submodule add git://github.com/msadouni/cakephp-contact-plugin.git plugins/contact`
git submodule init
git submodule update
Archive
Download the archive from github and extract it in
plugins/contactUsage
- Import the sql in
plugins/contact/config/sql/contact.sqlin your database - In
config/bootstrap.phpor a config file, specify the email you wish to receive the contacts on : Configure::write('Contact.email', 'you@example.com'); - To get the included french translation, add
Configure::write('Config.language', 'fre');toconfig/bootstrap.phpor a config file. - The contact form is by default located at
/contact/contacts/add
Customizing
- You can add a custom routes to your
config/routes.phpfile if you wish :Router::connect('/contact', array( 'plugin' => 'contact', 'controller' => 'contacts', 'action' => 'add')); Router::connect('/contact/thanks', array( 'plugin' => 'contact', 'controller' => 'contacts', 'action' => 'thanks')); - Basic views and css are provided. You can override them by creating custom views for the form and thanks pages in
views/plugins/contact/contacts/add.ctpandviews/plugins/contact/contacts/thanks.ctp. The thanks view is only suitable for development, you'll have to create your own for production use.https://github.com/msadouni/cakephp-contact-plugin