<commit_before>#Contact form for CakePHP 2.x

##features
* multi language
* no tables needed
* custom routes
* validation
* spam protection

## installation
* clone github repository into your CakePHP Application plugin folder:

```bash
git clone https://github.com/patrickhafner/ContactForm-CakePHP-2.git Plugin/Contactform
```

* add following code into your Config/email.php and configure:

```php
public $contactform = array(
	    'transport' => 'Mail',
	    'from' => array('<EMAIL>' => 'example.<EMAIL> | contact form'),
	    'bcc' => '<EMAIL>',
	    'charset' => 'utf-8',
	    'headerCharset' => 'utf-8',
	);
```

other config:

```php
public $smtp = array(
		'transport' => 'Smtp',
		'from' => array('site@localhost' => 'My Site'),
		'host' => 'localhost',
		'port' => 25,
		'timeout' => 30,
		'username' => 'user',
		'password' => '<PASSWORD>',
		'client' => null,
		'log' => true,
		'charset' => 'utf-8',
		'headerCharset' => 'utf-8',
);
```

* if you'd like to use an existing email configuration, please change Controller/ContactformController.php:

```php
$email->config('YOURCONFIG_IN_EMAIL_PHP');
```

* add following code in {APP_DIR}/Config/bootstrap.php

```php
CakePlugin::load('Contactform', array('routes' => true));
```

or use this code to load all plugins, located in your application
```php
CakePlugin::loadAll(); // Loads all plugins at once
```

* test contact form with following url: **http://yourapp.example.com/contact**

##screenshot
![screenshot](https://raw.github.com/patrickhafner/ContactForm-CakePHP-2/master/screenshot.png)

## todo

~* create mail template~

##license
MIT license

You are free to use this contact form plugin in commercial projects as long as the copyright header is left intact.

Copyright (C) 2013 <NAME> <<EMAIL>>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
<commit_msg>spam protection + email template final<commit_after>#Contact form for CakePHP 2.x

##features
* multi language
* no tables needed
* custom routes
* validation
* spam protection

## installation
* clone github repository into your CakePHP Application plugin folder:

```bash
git clone https://github.com/patrickhafner/ContactForm-CakePHP-2.git Plugin/Contactform
```

* add following code into your Config/email.php and configure:

```php
public $contactform = array(
	    'transport' => 'Mail',
	    'from' => array('<EMAIL>' => 'example.com | contact form'),
	    'bcc' => '<EMAIL>',
	    'charset' => 'utf-8',
	    'headerCharset' => 'utf-8',
	);
```

other config:

```php
public $smtp = array(
		'transport' => 'Smtp',
		'from' => array('site@localhost' => 'My Site'),
		'host' => 'localhost',
		'port' => 25,
		'timeout' => 30,
		'username' => 'user',
		'password' => '<PASSWORD>',
		'client' => null,
		'log' => true,
		'charset' => 'utf-8',
		'headerCharset' => 'utf-8',
);
```

* if you'd like to use an existing email configuration, please change Controller/ContactformController.php:

```php
$email->config('YOURCONFIG_IN_EMAIL_PHP');
```

* add following code in {APP_DIR}/Config/bootstrap.php

```php
CakePlugin::load('Contactform', array('routes' => true));
```

or use this code to load all plugins, located in your application
```php
CakePlugin::loadAll(); // Loads all plugins at once
```

* test contact form with following url: **http://yourapp.example.com/contact**

##screenshot
![screenshot](https://raw.github.com/patrickhafner/ContactForm-CakePHP-2/master/screenshot.png)

## todo

* ~~create mail template~~

##license
MIT license

You are free to use this contact form plugin in commercial projects as long as the copyright header is left intact.

Copyright (C) 2013 <NAME> <<EMAIL>>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

{'fraction_non_alphanumeric': 0.14183284786018374, 'fraction_numerical': 0.0067219359175442524, 'mean_word_length': 4.66497461928934, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 56, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6825965', 'n_tokens_mistral': 1423, 'n_tokens_neox': 1328, 'n_words': 476}