Plugin for Grav CMS that adds a form action to create a Freshdesk ticket
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor first commit Oct 19, 2017
CHANGELOG.md
LICENSE
README.md first commit Oct 19, 2017
blueprints.yaml first commit Oct 19, 2017
composer.json first commit Oct 19, 2017
composer.lock
freshdesk.php
freshdesk.yaml first commit Oct 19, 2017

README.md

Grav Freshdesk Plugin

This Grav plugin creates a ticket in your Freshdesk account when the user submits a form.

Installing / Updating

You can install this plugin through the Grav Package Manager (GPM):

bin/gpm install freshdesk

This will install the plugin into your /user/plugins directory within Grav. To update to the latest version:

bin/gpm update freshdesk

Configuration

User configuration should go in /user/config/plugins/freshdesk.yaml. Here's a sample config file:

enabled: true
api_key: *******************
domain: mysite
  • api_key (required): Your Freshdesk API key.
  • domain (required): The subdomain part of your Freshdesk URL (e.g. if your URL is https://mysite.freshdesk.com, then enter mysite).

Usage

Here's how you would use this plugin in a page that contains a form:

form:
    name: contact
    fields:
        -
            name: name
            label: 'Name'
            type: text
        -
            name: email
            label: 'Email Address'
            type: email
        -
            name: subject
            label: 'Subject'
            type: text
        -
            name: description
            label: 'Message'
            type: textarea
    buttons:
        - type: submit
          value: Submit
    process:
        -
            freshdesk:
                name: '{{ form.value.name }}'
                email: '{{ form.value.email }}'
                subject: '{{ form.value.subject }}'
                description: '{{ form.value.description|nl2br }}'

Let's look at the parameters of the freshdesk form action:

  • name: Name of the requester.
  • email (required): Email address of the requester. If no contact exists with this email address in Freshdesk, it will be added as a new contact.
  • subject (required): Subject of the ticket.
  • description (required): HTML content of the ticket.

Credits / Thanks

This plugin uses Freshdesk PHP SDK API v2.