We hope to present the various Zoho services that support Deluge through a series of posts. In today's post let us explore Deluge in Zoho Mail.
feature that encompasses Deluge. When a Deluge function is associated with a Zoho Mail filter, the configured filter criteria acts as a rule based on which the Deluge function will be triggered.
Let's assume a vendor sends invoices of your purchases to your email from
. Whenever you receive the invoice email, you post the
invoice ID, invoice date,
details in a Zoho Cliq channel. However, manually posting the invoice details in a channel is not only monotonous but also could lead to accidental blunders or any manipulation of data. To overcome this, Deluge can be used to automate the whole process. All the invoices follow the below structure.
Follow the below steps to achieve the mentioned automation.
Step 1: Navigate to Deluge
1. Click settings icon on the right pane and click Create New Incoming Filter from the Filters card.
2. A Deluge function needs to be triggered whenever a mail is received from
. Hence, provide the following filter conditions, choose
Custom function (Creator)
under Actions, and click
3. A popup window with
Deluge custom function
, frequently used Deluge functions as
Deluge's connections page
will be displayed.
Step 2: Script using Deluge
1. Navigate to
DRE Connectors tab
and create a Zoho OAuth
. Name the connection as
This connection is used to authenticate the Zoho Cliq account in which the message will be posted.
2. Navigate to Custom function tab, write the following script, and click Save. You can use the Test Run button to execute your script for a specific email.
// Fetch message details using
Zoho Mail integration task
messageDetails = zoho.mail.getMessage(mail_messageId, "extractandpost");
the mail content
mailContent = messageDetails.get("CONTENT");
// Handle the returned text to structure it in a valid XML format
mailContent = mailContent.replaceAll("<meta />","");
mailContent = mailContent.replaceAll(" ","");
XPath to fetch
the required details from the XML
invoiceId = mailContent.executeXPath("/div/div/div/div/text()");
invoiceDate = mailContent.executeXPath("/div/div/div/div/text()");
invoiceTotal = mailContent.executeXPath("/div/div/div/div/text()");
// Format the fetched details to post in Zoho Cliq channel
textToPost = "Zylker invoice\nInvoice ID: " + invoiceId + "\nInvoice Date: " + invoiceDate + "\nTotal: " + invoiceTotal;
// Post the formatted text in the required
Zoho Cliq Channel
zoho.cliq.postToChannel("OrdersChannel", textToPost, "extractandpost");
Select Custom Function
button to associate the function with the Filter.
Step 3: Save the filter
Now that the configuration is done, if an email is received from
, the mail content will be parsed and the required details will be posted in Zoho Cliq Channel automatically.
This example assumes emails from
always follow the same email template. The XML handling and XPath used in the provided example script is specific to this email template.
Please check the attachments for the sample XML file based on which the provided example script works.
We hope you found this post useful. We will explore Deluge in Zoho Writer in the next post. Please let us know your questions, feedback, and suggestions in the comments or write to us at