2017 © Pedro PelĂĄez
 

library zendesk-contact

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

image

mfcc/zendesk-contact

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

  • Wednesday, July 22, 2015
  • by bedi
  • Repository
  • 3 Watchers
  • 0 Stars
  • 450 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 2 % Grown

The README.md

Total Downloads, (*1)


MfccZendeskContact

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)

Install:

The suggested installation method is via composer:, (*4)

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

Usage:

  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, (*5)

Extend form:

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);

The Versions

22/07 2015

dev-master

9999999-dev https://github.com/Tlapi/mfcc-zendesk-contact

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

  Sources   Download

MIT

The Requires

 

form contact spam ticket zendesk