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!
Wechaty Freshdesk Plugin helps you to manage your customers/leads/users in the WeChat Room, with the power of the Freshdesk service.
- Wechaty v0.40+
- Freshdesk Garden Plan+ (for Assuming identities support)
- Freshdesk config
- Create two custom ticket fields
- Create Webhook
import { WechatyFreshdesk } from 'wechaty-freshdesk'
const config = {
contact: true, // enable direct message.
room: 'room_id@chatroom', // enable a specific room. `true` for enable all room
mention : true,
webhookProxyUrl : 'https://smee.io/your_smee_io_proxy_url',
apiKey : 'your_freshdesk_api_key',
portalUrl : 'https://your_portal_name.freshdesk.com',
}
const FreshdeskPlugin = WechatyFreshdesk(config)
const wechaty = new Wechaty()
wechaty.use(FreshdeskPlugin)
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.
In order to receive the reply and close events from Freshdesk, we need to configure the Freshdesk platform:
- Add two custom ticket fields
- Add a automation rule for Webhook
Note: Freshdesk Garden Plan (or above) is required, because we need Assuming identities feature.
- Login to your Freshdesk agent account, from the menu on the left, select
Admin
, then selectTicket Fields
under theGeneral Settings
. - Create two
Single-line text
fields:Wechaty Room
Wechaty Contact
Doc: Creating custom fields in your ticket form
- 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
.
- 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}}
Wechaty Room {{ticket.cf_wechaty_room}}
Wechaty Contact {{ticket.cf_wechaty_contact}}
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+)
The following two environment variables will be used if the required information is not provided by the config.
process.env.WECHATY_PLUGIN_FRESHDESK_PORTAL_URL
will be used if the config.portalUrl
is not provided.
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
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.
Our Friday BOT are using wechaty-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
Release 1.0 of Wechaty Freshdesk Plugin.
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 Plan
-
Assuming identities requires Garden Plan
-
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
- Rename
at
tomention
in config - Support managing tickets from different WeChat rooms
- Init code base
- Room message to Freshdesk
- Freshdesk message to Room (Powered by Smee.io)
Huan LI (李卓桓), Tencent TVP of Chatbot, <zixia@zixia.net>
- Code & Docs © 2020 Huan LI <zixia@zixia.net>
- Code released under the Apache-2.0 License
- Docs released under Creative Commons