Zendesk
What it does
Opens a ticket in Zendesk for each new submission of a form. The form can send every ticket to one group, or let the visitor choose the group, the priority or the type with fields of their own.
What Zendesk receives:
- the requester's name and email address. The name is the form's submitter name, otherwise the customer account's
name, or
Guest. See Submission Identity in Form settings; - the submission title as the subject, with the reference number in front when the form has one (a field with Hide in Submissions only when its Allow in Staff Email Subject is on);
- the whole submission as the ticket's first comment: every answer except those of fields with Hide in Submissions switched on, including answers of fields you deleted from the form later;
- the group, priority, type, followers and tags, and the fields you map;
- files from a File field you map, added to the ticket in a private comment.
The ticket is tied to the email address the visitor typed, and WebForms does not check that the address belongs to them. Someone who enters another person's address opens a ticket as that person. If you reply from Zendesk, the reply goes to that address.
A field with Hide in Submissions stays in the ticket's subject when its Allow in Staff Email Subject is on, as in the subject of emails to your team. Zendesk opens the ticket in the visitor's name and, by default, emails them its subject; the subject also shows in the help desk's customer portal. Switch that setting on only for a value the visitor may see.
To keep an answer out of the ticket, switch on Hide in Submissions for its field and leave Allow in Staff Email Subject off. That also hides the answer wherever a submission is displayed: in the admin, the customer account, emails and PDFs. See General field settings.
So that a repeated send doesn't open a second ticket, WebForms keeps the ticket it sent, answers included, in your store's cache for as long as Zendesk remembers the request.
Install
composer require mageme/module-webforms-addon-zendesk
bin/magento setup:upgrade
Composer also installs Zendesk's own library, which the add-on needs. If the add-on was copied into the store without Composer, the library is missing and no ticket is opened.
Settings
Connect your Zendesk account
Go to Stores → Configuration → MageMe Extensions → WebForms, expand Integrations, then Zendesk. Enter your
Zendesk Domain, the Agent Email Address of the agent that opens the tickets and that agent's Agent Token.
Enter the domain as yourdomain or yourdomain.zendesk.com. A full address such as https://yourdomain.zendesk.com
is accepted too, and anything after the host is dropped. Save Config refuses an address that isn't on
zendesk.com.
The hint under Agent Token says where to create it in Zendesk. Click Save Config. The Test Connection
button appears once the connection is saved; click it to check that WebForms can reach Zendesk.
These settings can differ per store view, so each store view can open tickets in its own Zendesk account.
Choose what a form sends
- Go to Content → WebForms → Manage Forms and click the form's name.
- Under Form Information, click Zendesk Integration Settings.
- Select Yes in Enable Zendesk Integration.
- In Customer Email, keep Default or pick the form's email field. Default is the address in the form's Submitter Email setting, or the customer account's address.
- Pick the Group, Priority and Type for the tickets, and the agents in Followers. In Tags, enter one tag per line.
- Under Fields Mapping, click Add for each ticket field you want to fill. Pick it in Zendesk Ticket Attribute and the form field in Field.
- Click Save.
Groups, agents and your own ticket fields come from your Zendesk account. On a saved form, click Refresh Lists in the section to load them, or to load them again after you change something in Zendesk.
Let the visitor choose the group, priority or type
The builder's palette has a Zendesk group with three fields:
| Field | What the visitor picks | What it replaces |
|---|---|---|
| Group (Zendesk Group) | One of your Zendesk groups | The form's Group |
| Priority (Zendesk Priority) | Low, Normal, High or Urgent | The form's Priority |
| Type (Zendesk Type) | Question, Incident, Problem or Task | The form's Type |
When the visitor leaves such a field empty, the form's setting is used. The groups in a Group field come from your Zendesk account and are kept up to date by Magento's scheduled tasks (cron). Like other fields with options, these fields can drive conditional logic.
How it works
When a visitor submits the form, WebForms saves the submission and then queues it for Zendesk. The queue is worked through by Magento's scheduled tasks (cron), so the ticket appears shortly after the visit. A form set to Do Not Store Submissions sends during the visit instead. Editing a submission later doesn't send it again. A submission without an email address is skipped.
To send submissions that already exist, or to send one to a particular group:
- Go to Content → WebForms → Manage Forms.
- In the form's row, click Select in the Actions column, then click Browse Results.
- Select the checkboxes of the submissions.
- Click Actions, then Create Zendesk Ticket.
- Click Group from Form to use the group the submission or the form names, or click one of your Zendesk groups. Confirm.
WebForms reports how many submissions were sent, skipped and failed. Create Zendesk Ticket is in the menu only while the integration is on for the form and the connection is saved, and only for admins with the Edit Result permission. A group you pick here wins over the group the visitor picked and the form's Group.
Sent again for the same group while Zendesk still remembers the first request, a submission gets back the ticket it already has, even if you edited the submission meanwhile. Sent for another group, it opens a ticket of its own.
To check that it worked, look for the ticket in Zendesk. WebForms doesn't mark a submission as sent.
Troubleshooting
- Nothing reaches Zendesk. Check that Enable Zendesk Integration is on for the store view the form was sent
from, and click Test Connection in the store configuration. Ask whoever runs your server to check that Magento
cron is running and to search Magento's system log for "Zendesk" in any letter case. The lines about sending
start with "WebForms integration" and name the service in lowercase, as
zendesk. - The log says "Zendesk domain not configured." although a domain is filled in. A domain saved before 4.0 that
isn't a Zendesk address counts as missing, and the submission is skipped. Enter it again as
yourdomainoryourdomain.zendesk.com, click Save Config, and send the submission again from the list. - The log says the Zendesk integration needs a library. The add-on was installed without Composer. Ask your developer to install it with the commands under Install.
- The connection details were refused. The log shows "WebForms integration: delivery failed" for
zendeskwith the code 401: WebForms tries three times and then gives up. Sending from the list reports "Zendesk did not accept the credentials". Check the connection with Test Connection, save, and send the waiting submissions again from the list. - Zendesk refused the ticket, for example because a mapped value doesn't fit the ticket field. WebForms doesn't try again. Correct the cause and send the submission again from the list.
- Zendesk didn't answer, or answered with a server error or "too many requests". WebForms tries again, up to three tries in all, waiting longer before each one. After the third failure it gives up and writes an error to the log.
- A Group field shows no groups. Check the connection with Test Connection in the store configuration, then click Refresh Lists in the form's Zendesk section. Magento's scheduled tasks also load the groups, so cron must be running.
What's next
- Settings: Integrations: the Zendesk connection.
- Integrations: the other services WebForms can send to.
- Conditional logic: show fields depending on the group a visitor picks.