Contact-Form using a honeypot for spam-protection and zendesk API for creating ticket

dev-master 2015-07-22 09:29 UTC

This package is auto-updated.

Last update: 2024-05-29 03:32:57 UTC


Total Downloads


This Modules provides a simple contact-form with spam-protection using a honeypot and Zendesk API for ticket creation. It is based on the OrgHeiglContact module by Andreas Heigl (

The idea of the honeypot is based on a blogpost by Lorna Jane Mitchell (according to Andreas Heigl)


The suggested installation method is via composer:

php composer.phar require mfcc/zendesk-contact:dev-master


  1. In your application.conf-file add the Module to the list of modules
  2. Configure your settings
  3. Link to the Form using $this->url('contact')
  4. There is no step four.

View plugin:

Use echo $this->mfccContactWidget() to show contact form anywhere in your views

Extend form:

Extend base contact form using init listeners in your Module.php like this:

public function onBootstrap(MvcEvent $e)
        $eventManager        = $e->getApplication()->getEventManager();
        $moduleRouteListener = new ModuleRouteListener();
	$em = $eventManager->getSharedManager();
			$form = $e->getTarget();
					'name' => 'username',
					'options' => array(
						'label' => 'Username',
					'attributes' => array(
						'type'  => 'text',

Note that you need to render and process form for yourself if you extend it.

To process your customized form, you can use zendesk service. Customize your zendesk service with $this->getServiceLocator()->get('zendeskService')->addTag($tag) $this->getServiceLocator()->get('zendeskService')->addCustomField($key, $value) etc. See ZendeskService.php

And create ticket like this:

$this->getServiceLocator()->get('zendeskService')->createTicket($fromName, $fromEmail, $yourCustomizedBody);