In this blog post, I'd like to show you how you can automate business workflows (either for support, sales or operations) that involve customer conversations by combining three tools: Front, MonkeyLearn, and Zapier.
Front will help us gather and manage conversations with customers from various different channels. MonkeyLearn will apply machine learning: automatically tagging conversations based on the content. Zapier will be the glue that sticks everything together.
Let's do it!
Front is a beautiful application that allows your team to manage a shared inbox. Front is redesigning email for business, where collaboration is key.
Some of Front's top features:
Front's set of features is a nice fit for multiple use cases; support, sales, and operations being the most frequent.
Tags are labels to help you keep track of conversations related to a given topic. Team Tags are visible to everyone on your Team. In analytics, admins can create reports based on tags. You can click the +tag button at the top of the message to apply a tag.
Rules save you time by automating repetitive processes. For example, you can create a rule to assign incoming messages to specific teammates, add tags to certain types of conversations, or always reply with a canned response.
By combining tags and rules in Front you can automate many of your workflows. These rules can help you handle repetitive tasks to save time and increase your team's efficiency:
Automatic routing to assign messages to your team members based on tags such as topic or issue type.
Automatic prioritization to enrich incoming messages with additional context to help prioritize or triage based on tags such as urgency, sentiment or topic.
Automatic responses to trigger auto responses based on tags such as intent, issue type, topic, urgency, and sentiment.
Consistent analytics to build reports within Front or using external BI tools, with the aim to detect:
Tagging is important and has many benefits but at the cost of time and effort. Tagging every single message that comes in can be a pain for many teams:
In MonkeyLearn we believe that manual repetitive tasks that involve text processing should be done by machines. By combining text classifiers and text extractors, MonkeyLearn can turn unstructured text data (such as emails, texts, and social media) into structured data, i.e., tags. Those tags can then be used to automate your business workflows as described above. Picture each MonkeyLearn model (classifier or extractor) as a dedicated robot working just for you, handling the repetitive stuff while you focus on the strategic.
So far this sounds beautiful, doesn't it? Let's jump right in and show you how to set it up.
To figure out how you want to tag messages, you can look at some of MonkeyLearn's premade models (such as sentiment, urgency, keywords and more) or build your own custom models (where you define your own set of tags, and train a custom classifier or extractor to recognize them).
One of the quickest ways to connect Front with MonkeyLearn is through Zapier, which will allow us to create a zap with the following steps:
First, you have to add three inputs, and fill them with the following info:
Then, with the above filled out, you must copy the following Python code snippet in the Code field:
from datetime import date, datetime
import json
from requests import sessions
_session = sessions.Session()
class Serializer(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, (date, datetime)):
return obj.isoformat()
return json.JSONEncoder.default(self, obj)
class APIError(Exception):
def __init__(self, status, code, message):
self.message = message
self.status = status
self.code = code
def __str__(self):
msg = "[Error] {0}: {1} ({2})"
return msg.format(self.code, self.message, self.status)
def patch(convo_id, tags, write_key):
"""Post the `kwargs` to the API"""
data = {
'tags': tags
}
url = 'https://api2.frontapp.com/conversations/' + convo_id
data = json.dumps(data, cls=Serializer)
headers = {
'Content-type': 'application/json',
"Accept": "application/json",
"Authorization": 'Bearer ' + write_key
}
res = _session.patch(url, data=data, headers=headers, timeout=15)
if res.status_code == 200 or res.status_code == 204:
return "[Response]: OK"
try:
payload = res.json()
raise APIError(res.status_code, payload['code'], payload['message'])
except:
raise APIError(res.status_code, 'unknown', res.text)
res = patch(input_data['convo_id'],
input_data['tags'].split(","),
input_data['write_key'])
output = [{'res': res}]
When your zap is set up and running, this is what a Front message will look like. You will see the automatically populated tags on the top of every message. Cool!
These are some cool rules that you can set up in Front to trigger when tags are automatically populated:
You can also get some cool analytics based on your tags that can help spot trends in your messages and conversations:
With the above, we have quickly created a way to automate tagging incoming messages in Front using machine learning. Based on these tags, you can trigger even more automations within Front, such as assigning convos or replying with canned responses. Feel free to add, edit and experiment with more models and rules, and reach out to me if you have any questions or comments. Happy hacking!
August 17th, 2018