Giter Site home page Giter Site logo

contact's Introduction

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 type

git 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/contact

Usage

  1. Import the sql in plugins/contact/config/sql/contact.sql in your database
  2. In config/bootstrap.php or a config file, specify the email you wish to receive the contacts on : Configure::write('Contact.email', '[email protected]');
  3. To get the included french translation, add Configure::write('Config.language', 'fre'); to config/bootstrap.php or a config file.
  4. The contact form is by default located at /contact/contacts/add

Customizing

  • You can add a custom routes to your config/routes.php file 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.ctp and views/plugins/contact/contacts/thanks.ctp. The thanks view is only suitable for development, you'll have to create your own for production use.

Translating

The form view contains the string used by error messages so they can be extracted with cake i18n tool. Feel free to fork the code, translate it in your language and make a pull request or contact me so I can include it in the plugin.

TODO

  • Add an admin section to view and search the contacts, and remove the ones you don't want to keep

contact's People

Contributors

essemme avatar josegonzalez avatar msadouni avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.