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 to true, customers need to use @ to mention the bot when they want to ask questions.
config.webhookProxyUrl: A smee.io link that you need to set it to receive the Freshdesk Webhook events.
wechaty-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
Usage
config.contact: Whether to allow direct message to be sync with ticket reply.falseto deny all,truefor 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.iolink that you need to set it to receive the Freshdesk Webhook events.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 the Freshdesk platform:
1 Add Two Custom Ticket Field
Admin, then selectTicket Fieldsunder theGeneral Settings.Single-line textfields:Wechaty RoomWechaty ContactDoc: Creating custom fields in your ticket form
2 Go to Automation Setting Page
Admin, then selectAutomations.Rules that run on, there will be three selections:Ticket Creation,Time Triggers, andTicket Updates.3 Create a
Ticket UpdatesRuleTicket Updates, click theNew rulebutton.Ticket is updatedan action performed by Agentpublic Note is AddedOR
When Reply is SentTrigger Webhook Method- POST Url: https://smee.io/your_smee_io_proxy_urlAnd 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.See:
Environment Variables
The following two environment variables will be used if the required information is not provided by the config.
1
WECHATY_PLUGIN_FRESHDESK_PORTAL_URLprocess.env.WECHATY_PLUGIN_FRESHDESK_PORTAL_URLwill be used if theconfig.portalUrlis not provided.2
WECHATY_PLUGIN_FRESHDESK_API_KEYprocess.env.WECHATY_PLUGIN_FRESHDESK_API_KEYwill be used if theconfig.apiKeyis not provided.Learn more about the authorization token of freshdesk: Freshdesk API - How to find your API key
3
WECHATY_PLUGIN_FRESHDESK_WEBHOOK_PROXY_URLWe 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_URLwill be used if theconfig.webhookProxyUrlis not provided.See:
Screenshot
Example
Our Friday BOT are using
wechaty-freshdeskto 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 1.0 (Oct 23, 2021)
Release 1.0 of Wechaty Freshdesk Plugin.
v0.6 Renamed from
wechaty-plugin-freshdesktowechaty-freshdeskAfter 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_idas a workaround ofunique_external_idChange custom ticket fields on Freshdesk to store
roomIdandcontactIdfrom WechatyChange webhook setting on Freshdesk
v0.4 (July 21, 2020)
attomentionin configv0.2 (June 26, 2020)
Contributors
Author
Huan LI (李卓桓), Tencent TVP of Chatbot, <zixia@zixia.net>
Copyright & License