🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Zammad Premium Add-on Setup Guide

Updated 9 min read Gravity Forms Integrations A–Z
On this page
  1. Video walkthrough
  2. What you need
  3. Create an API token in Zammad
  4. Install and connect
  5. Create a feed
  6. Customer
  7. Ticket
  8. What happens on submit
  9. Merge tags and notifications
  10. Retries never create duplicates
  11. Errors and what they mean
  12. Security and privacy
  13. For developers
  14. Questions
  15. Does it work with a hosted Zammad?
  16. Can one form create tickets in different groups?
  17. Are file uploads attached?

Video walkthrough

Gravity Forms Zammad Add-On Setup Guide: Helpdesk Tickets from Entries (WordPress Side)
Video setup guide: Gravity Forms Zammad Watch on YouTube

The Gravity Forms Zammad Premium Add-on connects your WordPress forms to Zammad, the open-source helpdesk and customer support system. When someone sends a form, the add-on finds the Zammad customer with the same email address, or creates one, and opens a ticket for that customer with the title, group, priority, state and tags you choose. The answers from the form become the first article of the ticket, so your agents can reply from Zammad straight away.

It works with any Zammad you can reach over the internet: a hosted Zammad or a self-hosted Zammad on your own server, even one that lives in a sub-folder or on its own port. You enter the address and a personal API token (HTTP Token Access); the token is stored encrypted, and the add-on only ever contacts the Zammad address you set. This guide walks through the setup, every feed option, retries, notifications and what happens when something goes wrong.

What you need

  • WordPress with Gravity Forms 2.9 or newer.
  • PHP 7.4 or newer.
  • An active license key for this add-on.
  • A Zammad with HTTP Token Access switched on, and an agent account that can create tickets in the groups you plan to use.

If Gravity Forms is missing or older than 2.9, the add-on shows a notice in the WordPress admin and does nothing else, so a form is never left half connected.

Create an API token in Zammad

The add-on talks to the Zammad REST API with a personal access token. Creating one takes a minute:

  1. As a Zammad administrator, open Settings → System → API and switch on Token Access. Without it Zammad refuses every token.
  2. Log in as the agent the tickets should be created by. Click the avatar, open Profile → Token Access and click Create.
  3. Give the token a name such as “Website forms” and tick the ticket.agent permission. If that agent account may not create customers on your Zammad, also tick admin.user.
  4. Copy the token now. Zammad shows it only once. Treat it like a password.

The token acts with the rights of that agent. Tickets can only be created in groups the agent has access to, which is a simple way to keep form tickets inside the groups you intend.

Install and connect

  1. Upload and activate the add-on in Plugins → Add New → Upload Plugin.
  2. Open Forms → Settings → Zammad, paste your license key and activate it. The Zammad fields appear once the license is active.
  3. Enter the Zammad address: the address you open Zammad with, such as https://support.yourcompany.com or https://yourcompany.zammad.com. Do not add /api/v1; the add-on adds it.
  4. Paste the API token.
  5. Type the Default group, for example Users or Support. A feed that leaves its own group empty uses this one.
  6. Click Test connection, then Save Settings.
The Zammad settings page in Gravity Forms: license key, Zammad address, API token, default group and a Test connection button showing the connected agent
The settings page: Zammad address, API token, default group and the Test connection result.

Test connection uses the values that are typed on the screen, even before you save. It asks Zammad who the token belongs to and reads the list of groups. A good result reads “Connected as Olivia Hart. Groups: Users, Sales, Support”. When a default group is typed it is checked too, and a group that does not exist is reported together with the groups that do. A wrong token shows the answer from Zammad, such as “HTTP 401: Authentication required”.

The token field is a password field. After saving, the token is encrypted with AES-256-GCM using a key derived from the WordPress salts of your site, and it is never shown again or written to a log. If you prefer to keep it out of the database, add define( 'GFZM_API_TOKEN', 'your-token' ); to wp-config.php; the settings screen then says the token comes from that constant.

Create a feed

Open a form, go to Settings → Zammad and click Add New. A form can have several feeds, for example one for sales questions and one for support, each with its own condition.

The Zammad feed settings in Gravity Forms: customer email and name, ticket title, group, body, article type, priority, state, tags and the condition
A feed: the customer fields and every ticket option, with merge tags for routing.

Customer

  • Customer email (required): the merge tag of your email field, for example {Email:2}. The add-on searches Zammad for a user with exactly this address. A near match such as a similar address on another domain is never used.
  • Customer name: for example {Name (First):1.3} {Name (Last):1.6}. It is used when a new customer is created; the last word becomes the last name. An existing customer is never renamed by a form.

Ticket

  • Title: the ticket title, {form_title} by default. Merge tags work, so “Billing question from {Company:4}” is a good title.
  • Group: the Zammad group, such as Sales or a sub-group like Support::Billing. Leave it empty to use the default group. A merge tag lets a form choice route the ticket: give a drop-down the group names as values and set the group to its merge tag with the :value modifier, such as {Topic:5:value}, so the value is used and not the label the visitor sees.
  • Body: the first article of the ticket. {all_fields} becomes a plain list of every answer; you can add your own text around it. Answers that a visitor types are never treated as merge tags.
  • Add the body as: a web message from the customer (the ticket looks like the customer wrote it, and replies go to them) or an internal note that only agents see.
  • Entry link: adds the form name and a link back to the Gravity Forms entry at the end of the body.
  • Priority: 1 low, 2 normal or 3 high. A merge tag also works, such as {Urgency:6:value}; the values 1, 2, 3, low, normal and high are understood, and anything else becomes 2 normal.
  • State: new, open or closed.
  • Tags: a comma-separated list such as website, {Topic:5:value}. Duplicates and empty values are dropped.
  • Condition: standard Gravity Forms conditional logic. The ticket is created only when the rule matches.

What happens on submit

A front-end Gravity Form for contacting support with name, email, phone, company, topic, urgency and a message field
A support form on the site. The topic and urgency choices route the ticket.
  1. The visitor sees your normal confirmation. Zammad is never mentioned to them and a slow Zammad never blocks the form.
  2. The add-on searches Zammad for the customer with GET /api/v1/users/search. If there is no exact match, it creates the customer with POST /api/v1/users and the Customer role.
  3. It creates the ticket with POST /api/v1/tickets, sending the title, group, customer, state, priority and tags, with the first article nested in the same request.
  4. The entry receives a note such as “Zammad: customer #41 created, ticket #32201 created in group Support, tags website, high” with a link to the ticket. The ticket number, the ticket link and the customer link are stored on the entry and can be shown as entry list columns.
A Gravity Forms entry screen with the field values and a note confirming the Zammad customer and ticket were created, with the ticket link
The entry keeps a note with the ticket number and a link straight to the ticket in Zammad.

Merge tags and notifications

Three merge tags carry the result into your notifications and confirmations: {zammad_ticket_number}, {zammad_ticket_url} and {zammad_ticket_id}. They appear in the merge tag list of every notification. A confirmation email to the visitor can include “Your ticket number is {zammad_ticket_number}”, and an internal email can link to the ticket.

The add-on also adds two notification events to the form: Zammad ticket created and Zammad ticket failed. Choose one in the Event setting of a notification. A “failed” notification to your support lead is a simple safety net: if Zammad is down or a group was renamed, someone hears about it at once.

Retries never create duplicates

Networks fail. The add-on is built so that a retry or the Resend Feeds action on an entry never creates a second customer or a second ticket:

  • The customer and ticket ids are stored on the entry. When a ticket already exists for the entry and feed, a resend only adds a note saying so.
  • Every ticket carries a reference for the entry and feed in its note attribute. If Zammad created the ticket but the answer was lost on the way back, the next try first searches for that reference and links the existing ticket instead of creating another.
  • If that search itself fails, no ticket is created and the note explains why, because a missing ticket is easier to fix than a duplicate.
  • If two requests create the same customer at the same moment and Zammad answers that the email is already used, the add-on looks the customer up again and uses it.
  • A feed that is already running for an entry is not started a second time.

Errors and what they mean

A failed call never stops the submission: the entry is saved, an error note explains what went wrong, and the “ticket failed” notification is sent. The token is removed from every message. Common notes:

  • HTTP 401: Authentication required: the token is wrong, was deleted, or Token Access is switched off in Zammad.
  • HTTP 403: the agent of the token may not do this, for example create tickets in that group or create customers.
  • HTTP 422: No lookup value found for ‘group’: the group name does not exist. Check the spelling, including the :: of a sub-group.
  • No group: neither the feed nor the settings name a group.
  • No valid customer email: the mapped field was empty or not an email address.
  • The address redirects: use the final address of your Zammad. Redirects are never followed, so the token cannot leak to another host.

After fixing the cause, open the entry and use Resend Feeds.

Security and privacy

  • Only https addresses are accepted. Addresses on private or local networks, and host names that resolve to one, are refused before any request is made.
  • The token travels only in the Authorization header, never in a URL, and requests verify the TLS certificate.
  • Nothing is sent anywhere except your Zammad and the GravityExtra license server.
  • Uninstalling the add-on removes its settings and the encrypted token. Customers and tickets already in Zammad stay as they are.

For developers

  • gfzm_ticket_input and gfzm_customer_input filter the values before they are sent.
  • gfzm_ticket_created runs after a ticket is created; gfzm_failed runs after an error.
  • gfzm_allow_private_hosts lets one Zammad inside your own network through, and gfzm_allow_insecure_http allows plain http for a test system.
  • gfzm_timeout changes the request timeout (20 seconds by default).

Questions

Does it work with a hosted Zammad?

Yes. Any Zammad reachable over https works, hosted or self-hosted, as long as Token Access is switched on.

Can one form create tickets in different groups?

Yes. Set the group to the merge tag of a drop-down whose values are group names, with the :value modifier, or add one feed per group with its own condition.

Are file uploads attached?

The addresses of uploaded files are listed in the ticket body, so agents can open them from the ticket. The files stay on your WordPress site.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr