wechaty-plugin-freshdesk
Freshdesk is a cloud-based helpdesk system that offers powerful solutions for customer service.
Wechaty Freshdesk Plugin helps Freshdesk unifies conversations from WeChat, and helps you resolve issues across channels effortlessly!
Introduction
Wechaty Freshdesk Plugin helps you to manage your customers/leads/users in the WeChat Room, with the power of the Freshdesk service.
Requirements
- Wechaty v0.40+
- Freshdesk Garden+ Plan
- Freshdesk config
- Create two custom ticket fields named
Wechaty Room
andWechaty Contact
with typestring
. See: Creating custom fields in your ticket form - Create Webhook (see below)
- Create two custom ticket fields named
Usage
wechaty.useFreshdeskPlugin
config.contact
: Whether to allow direct message to be sync with ticket reply.false
to deny all,true
for allow all; Supports contact id(string
) and contact name(RegExp
). You can also mix them in array.config.room
: The room id of your service WeChat room.config.mention
: If set totrue
, customers need to use@
to mention the bot when they want to ask questions.config.webhookProxyUrl
: Asmee.io
link that you need to set it to receive the Freshdesk Webhook events.- smee.io - Webhook payload delivery service - Receives payloads then sends them to your locally running application.
config.apiKey
: The API Key for your Freshdesk account.
Configure Freshdesk Webhooks
In order to receive the reply and close events from Freshdesk, we need to configure webhooks from the Freshdesk platform.
1 Go to Automation Setting Page
- Login to your Freshdesk agent account, from the menu on the left, select
Admin
, then selectAutomations
. - Below the
Rules that run on
, there will be three selections:Ticket Creation
,Time Triggers
, andTicket Updates
.
Ticket Updates
Rule
2 Create a - Select
Ticket Updates
, click theNew rule
button. - Configure the rule as the following summary:
- When
Ticket is updated
- When
an action performed by Agent
- When
public Note is Added
OR
When Reply is Sent
Trigger Webhook Method
- POST Url: https://smee.io/your_smee_io_proxy_url
- When
And make sure you have configured the Webhook Content as the following:
Ticket ID {{ticket.id}}
Last Public Comment {{ticket.latest_public_comment}}
Contact Unique External ID {{ticket.contact.unique_external_id}}
Then click Preview and save
.
Note: the
POST Url
must be as same as thewebhookProxyUrl
setting in theconfig
.
See:
- Using Webhooks in automation rules that run on ticket updates
- Setting up automation rules to run on 'Ticket Updates'
- Assuming identities (Garden+)
Environment Variables
The following two environment variables will be used if the required information is not provided by the config.
WECHATY_PLUGIN_FRESHDESK_PORTAL_URL
1 process.env.WECHATY_PLUGIN_FRESHDESK_PORTAL_URL
will be used if the config.portalUrl
is not provided.
WECHATY_PLUGIN_FRESHDESK_API_KEY
2 process.env.WECHATY_PLUGIN_FRESHDESK_API_KEY
will be used if the config.apiKey
is not provided.
Learn more about the authorization token of freshdesk: Freshdesk API - How to find your API key
WECHATY_PLUGIN_FRESHDESK_WEBHOOK_PROXY_URL
3 We receive webhook payloads with the help from <smee.io>, by proxy them to our locally running Wechaty Plugin application.
process.env.WECHATY_PLUGIN_FRESHDESK_WEBHOOK_PROXY_URL
will be used if the config.webhookProxyUrl
is not provided.
See:
- smee.io - Webhook payload delivery service - Receives payloads then sends them to your locally running application.
Screenshot
Example
Our Friday BOT are using wechaty-plugin-freshdesk
to connect our WeChat customers to Freshdesk.
You can read the source code from: https://github.com/wechaty/friday/blob/master/src/plugins/freshdesk.ts
See Also
History
master (v0.6)
After the Freshdesk trail was end, we found that the following features are belonging to different plans:
-
Identifying contacts with an external ID requires Estate
-
Assuming identities requires Garden
-
Supported both direct message and room messages to be managed by freshdesk via tickets
-
use
twitter_id
as a workaround ofunique_external_id
-
Change custom ticket fields on Freshdesk to store
roomId
andcontactId
from Wechaty -
Change webhook setting on Freshdesk
v0.4 (July 21, 2020)
- Rename
at
tomention
in config - Support managing tickets from different WeChat rooms
v0.2 (June 26, 2020)
- Init code base
- Room message to Freshdesk
- Freshdesk message to Room (Powered by Smee.io)
Contributors
Author
Huan LI (李卓桓), Tencent TVP of Chatbot, <zixia@zixia.net>
Copyright & License
- Code & Docs © 2020 Huan LI <zixia@zixia.net>
- Code released under the Apache-2.0 License
- Docs released under Creative Commons