With a major part of communication happening over emails, it becomes quite a task to keep up with a large amount of email threads. But when a huge portion of your everyday conversation happens in a messaging platform like Zoho Cliq, why not bring in important email notifications into your chats as well?
This forum post will walk you through on connecting your Zoho Mail with Cliq so you can get your emails straight away through your chats.
First, let's see how bringing in an email from Zoho Mail to Cliq can be useful.
Scenarios:
- The support team in every organization receives a substantial amount of emails on a daily basis. There are chances that a high priority email might slip through. So, to overcome this you can create a filter and funnel the high priority email to your team's support channel in Cliq or have a dedicated support bot that will bring in your highly important email.
- Similarly, you can keep a track of all the payments made by your customers and also track down specific emails from your partners and vendors directly from Cliq chat.
Steps:
Follow the simple steps given below to bring in your emails from Zoho Mail to Cliq and centralize them.
1. Log in to your Zoho Mail and click on the settings icon, which is located at the top of the right hand panel.
2. The second step involves creating a new incoming filter.
In the actions, select Custom function(creator) from the drop down.
Select Function to view the deluge script editor pop up.
- Go to the DRE Connectors tab and in My Connections, click on the Create Connection button.
- Select the Zoho OAuth service and enter your preferred connection and connection link name.
- For scopes, select the checkboxes for ZohoCliq.Webhooks.CREATE and ZohoMail.messages.READ .
- Now go back to the custom functions tab and paste the following code in the scipt editor :
- messageDetails = zoho.mail.getMessage(mail_messageId,"CONNECTION LINK NAME");
- mailContent = messageDetails.get("CONTENT").replaceAll("<br />","\n").replaceAll("<.*?>","").trim();
if(mailContent.trim().length() == 0)
{
mailContent = "-";
}
mailSubject = messageDetails.get("SUBJECT");
if(mailSubject.isNull())
{
mailSubject = "-";
}
fromAddress = messageDetails.get("FROM");
senderName = messageDetails.get("SENDER");
messageContent = {"text":"### " + mailSubject + "\n\n*Details*\nFrom: " + senderName + "\nEmail: " + fromAddress + "\nContent: " + mailContent,"card":{"theme":"7"},"bot":{"name":"Mail Notifier"}};
zoho.cliq.postToChannel("CHANNEL UNIQUE NAME",messageContent,"CONNECTION LINK NAME");
(NOTE : Replace "CONNECTION LINK NAME" with the name of the connection link that you have created, and "CHANNEL UNIQUE NAME" with the unique name of the channel in which you want the mail posted as a chat). 3. Give your custom function a name and click on the Save button to save it.
You can also check if the function works by selecting the Test Run button to execute the code. You will be prompted to enter a message ID for the check which can be retrieved from the URL. Open any mail you want to test it on and copy the last digits in the URL, paste it in the message ID text box and proceed. Sample Response
Note: In case you want to post a response to a bot use the following syntax:
Also you can post the response in a channel (organizational, personal, team or external) using the following syntax:
Retrieving a channel's unique name :
You can retrieve the unique name of a channel by the follwing steps :
1. Hover over to the channel in the left hand side panel and select more info.
2. Click on the connectors tab
3. The API Endpoint URL contains the channel's unique name in block letters.
There you go! We hope this brief example helped you understand in bringing an email from Zoho Mail to Zoho Cliq.
In case of any queries please comment below. We'd be happy to assist you.
Regards
Divya P
Zoho Cliq