Zoho Auto Reply: Respond to Zoho emails based on conditions

Updated on March 24,2023

In this article, you'll learn how to respond to Zoho Mails automatically using Zoho Zeluge.

Let's take a simple example of where you want to auto-respond to emails with a specific subject line.

How would we go about achieving this task?

  • Add an Incoming filter to Zohomail based on the subject line conditions
  • Create mail connection
  • Create action/custom function using Zoho Zeluge.

Create an Incoming Filter in Zohomail based on the subject line conditions.

The first step is to add a filter.

Filters can automate actions, such as creating a task from an email or auto-forwarding certain emails based on conditions to a specific email address.

To create an incoming filter, follow the following steps:

  1. Login to Zoho Mail
  2. Click the Settings icon.
  3. Go to Filters
  4. Open the Incoming Emails Filter tab.
  5. Click on New Filter.
  6. Let's give the filter name as the Subject line Re: Welcome.
  7. Select All the conditions (AND) as the condition type.
  8. Under the Conditions section, select Subject, then Begins with and in the value input box, enter Re: Welcome.
  9. In the actions section, click on Add an action and select custom function(creator). Click on the select function dropdown to add the custom function. We will do this in the next section.
  10. Check Do not check the filters for matching conditions.

add filter

Create mail connection

The first step is to create a mail connection with scope ZohoMail.messages.READ and ZohoMail.messages.CREATE.

  1. Under the DRE Connectors tab, click on create connection.
  2. Click on the Default Services tab and select Zoho OAuth.
  3. Give your connection an appropriate name.
  4. Toggle the use credentials of logged in user to Yes.
  5. Check ZohoMail.messages.CREATE and ZohoMail.messages.READ scopes.
  6. Click Create and Connect and give access in the op window.

connection scope zoho

 

accept access

Create action/custom function using Zoho Zeluge.

Next, we create a custom function to send the reply if an email meets the previously set conditions. We use Zoho Zeluge for this.

What is Zoho Zeluge?

It is Zoho's scripting language used to integrate the Zoho suite products and external applications. Just as AppScript is to Google Suite.

Follow the following steps to create the function:

  • Click on the custom functions tab
  • Give your function an appropriate name.
  • Add the following code snippet:

info "To get the email data, use the 'mail_messageId' parameter sent from mail filter when calling the Custom Function.";


info "To get the email data, use the 'mail_messageId' parameter sent from mail filter when calling the Custom Function.";

/*1. Create a mail connection with scope ZohoMail.messages.READ
2. Replace "mailconnectionname" to the name of your connection.*/
messageDetails = zoho.mail.getMessage(mail_messageId, "mailconnectionname");

// mailContent = messageDetails.get("CONTENT");
// mailSubject = messageDetails.get("SUBJECT");
fromAddress = messageDetails.get("FROM");

// replace from_email with your email address.
sendmail
[
	from: "from_email"
	to:fromAddress
		subject: "Re: Welcome to the Real Gluttons Club."
	message: "Greetings, fellow foodies!
Welcome to the 'We Are the Real Gluttons' newsletter! We're thrilled ..." ]

save function

Next, Save the function; then, in the previous window, select it as the custom function.

That's it! Our auto responder is ready to be tested.

Let's go ahead and test if the integration is working as expected.

From another account, draft an email whose subject line begins with Re: Welcome and send it to your Zoho mail as shown below:

You should immediately get a response similar to the image below:

test successful

Ready to automate your Zoho Suites workflow? Let me help you save time and work smarter! Book a call with me today for expert assistance with creating similar automation manually or using popular automation tools like Zapier and Make.



More in this category: Automatically create Google Slides from Google Form Response ยป