dev-master
9999999-dev https://github.com/Tlapi/mfcc-zendesk-contactContact-Form using a honeypot for spam-protection and zendesk API for creating ticket
MIT
The Requires
by Jan TlapĂĄk
form contact spam ticket zendesk
Contact-Form using a honeypot for spam-protection and zendesk API for creating ticket
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 (https://github.com/heiglandreas/OrgHeiglContact)., (*2)
The idea of the honeypot is based on a blogpost by Lorna Jane Mitchell (according to Andreas Heigl), (*3)
The suggested installation method is via composer:, (*4)
php composer.phar require mfcc/zendesk-contact:dev-master
$this->url('contact')
Use echo $this->mfccContactWidget()
to show contact form anywhere in your views, (*5)
Extend base contact form using init listeners in your Module.php like this:, (*6)
public function onBootstrap(MvcEvent $e) { $eventManager = $e->getApplication()->getEventManager(); $moduleRouteListener = new ModuleRouteListener(); $moduleRouteListener->attach($eventManager); $em = $eventManager->getSharedManager(); $em->attach( 'MfccZendeskContact\Form\ContactForm', 'init', function($e) { $form = $e->getTarget(); $form->add( array( '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., (*7)
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
, (*8)
And create ticket like this:, (*9)
$this->getServiceLocator()->get('zendeskService')->createTicket($fromName, $fromEmail, $yourCustomizedBody);
Contact-Form using a honeypot for spam-protection and zendesk API for creating ticket
MIT
form contact spam ticket zendesk