Extension pointers for integrating Zoho CRM with Zoho products #4: Handle and keep track of your Zoho Mail for deals within Zoho CRM

Extension pointers for integrating Zoho CRM with Zoho products #4: Handle and keep track of your Zoho Mail for deals within Zoho CRM

Regular email communication with Zoho CRM contacts, before or after signing or closing a deal, is a key component of effective customer relationship management. Having a separate section within the record page in Zoho CRM for emails associated with a specific deal makes it simple and easy to check the respective email data and set up further follow-ups.

In this post, we'll take a look at how to integrate Zoho Mail with Zoho CRM.

Consider the following scenario: A sales representative successfully closes and wins a deal. For the deal to close successfully, multiple emails will have been exchanged, along with several other emails in the future. Having all of the emails received from the deal's contact in your Zoho CRM as a related list in your deal's record can help you manage this data better.

Creating a connector for Zoho Mail and adding connector APIs
  • Create a new connector in your extension for Zoho Mail using the Connectors feature under Utilities in the left panel of the Zoho Developer console. 
Note: Zoho Mail follows OAuth2.0 protocols for authentication. You can refer to this post to better understand the steps to register Zoho Desk and retrieve your client credentials.

                                    

The connector details for our example are:
  • Add the necessary connector APIs for your functionality. Please refer to the Zoho Mail API guide for details. 
                                    
The Zoho Mail APIs added for our example are mentioned below.

Note: You can refer to this post to learn about the detailed steps involved in creating a connector, adding the connector APIs, and associating it with the extension.

Creating a related list and associating a function to it

Create a related list called "Related mails" using the Related details option present in the Components feature available in the Build section of the Zoho Developer console, then associate a function to perform the desired action.

Related mails - Related list code snippet

//Retrieving the deal record and fetching the deal name, contact name and contact ID
response = zoho.crm.getRecordById("Deals",deal.get("Deals.ID").toLong());
dealname = response.get("Deal_Name");
dealname = dealname.trim().toUpperCase();
dealname = replaceAll(dealname," ","_");
contact = response.get("Contact_Name");
id = contact.get("id");
// Retrieving the email ID of the contact associated with the deal by passing the id retrieved
response1 = zoho.crm.getRecordById("Contacts",id);
email = response1.get("Email");
dynamic_map = Map();
// Invoking the get account details API to fetch the account ID
response2 = zoho.crm.invokeConnector("jssdkextension.zohomail.getaccountsdetails",dynamic_map);
resp = response2.get("response");
data = resp.get("data");
for each item in data
{
zuid = item.get("zuid");
info zuid;
accountid = item.get("accountId");
info accountid;
}
dynamic_map = Map();
dynamic_map.put("accountId",accountid);
dynamic_map.put("emailid",email);
dynamic_map.put("dealname",dealname);
// Invoking the search results API to get the emails associated with the deal and contact of the deal
response3 = zoho.crm.invokeConnector("jssdkextension.zohomail.searchresults",dynamic_map);
info response3;
responsedata1 = response3.get("response");
data1 = responsedata1.get("data");
info data1;
// Constructing the related list
resp = "";
count = 1;
recordsXmlStr = "<record>";
for each value in data1
{
recordsXmlStr = recordsXmlStr + "<row no='" + count + "'>";

recordsXmlStr = recordsXmlStr + "<FL val='Subject'>" + value.get("subject") + "</FL>";
recordsXmlStr = recordsXmlStr + "<FL val='Summary'>" + value.get("summary") + "</FL>";
recordsXmlStr = recordsXmlStr + "<FL val='Sender'>" + value.get("sender") + "</FL>";
recordsXmlStr = recordsXmlStr + "</row>";
count = count + 1;
}
recordsXmlStr = recordsXmlStr + "</record>";
resp = resp + recordsXmlStr;
return resp;

  • The deal record details are fetched using the getRecord API and the deal name along with the contact name is retrieved from it. Similarly, the contact ID is passed to the getRecord API for the contacts module from which the contact's email ID is retrieved.
  • The account ID is also retrieved by invoking the get account details API.
  • This account ID is passed to the search results API along with the deal name and the email ID retrieved which are the search criteria for the mails to be filtered and displayed as a related list.
Now let's see a sample output of how this functionality works.

When a deal record is opened, the emails in the Zoho Mail account having the sender as the deal's contact's email address, and the deal name as a part of the mail are fetched and displayed as a related list.



This way you can integrate Zoho CRM with Zoho Mail, and the functionality can be enhanced based on your business requirements.

We hope you find this information useful. Keep following this space for more tips and recommendations!


SEE ALSO

    Access your files securely from anywhere

        Zoho FSM Video Tutorials


              All-in-one knowledge management and training platform for your employees and customers.






                                    Zoho Developer Community




                                                          • Desk Community Learning Series


                                                          • Digest


                                                          • Functions


                                                          • Meetups


                                                          • Kbase


                                                          • Resources


                                                          • Glossary


                                                          • Desk Marketplace


                                                          • MVP Corner


                                                          • Word of the Day


                                                          • Ask the Experts



                                                                    • Sticky Posts

                                                                    • Announcing the new SKILL.md for Zoho CRM and the updated OAS repository!

                                                                      We are introducing a new zoho-crm skill to make working with Zoho CRM Developer tools (like APIs, functions, widgets, client scripts, queries etc) easier and faster, with the help of AI in your preferred AI harness like Claude Code, Codex, Cursor, VSCode
                                                                    • Kaizen #256 - Build an Arrival Readiness Web Tab in Zoho CRM

                                                                      Hi everyone! Welcome back to the Kaizen series! In the post, we discuss a use case in hospitality industry: how an Arrival Readiness web tab widget can be used to let reception staff identify and resolve issues before arrival of guests. Use case In the
                                                                    • Kaizen #198: Using Client Script for Custom Validation in Blueprint

                                                                      Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
                                                                    • Kaizen #226: Using ZRC in Client Script

                                                                      Hello everyone! Welcome to another week of Kaizen. In today's post, lets see what is ZRC (Zoho Request Client) and how we can use ZRC methods in Client Script to get inputs from a Salesperson and update the Lead status with a single button click. In this
                                                                    • Kaizen #222 - Client Script Support for Notes Related List

                                                                      Hello everyone! Welcome to another week of Kaizen. The final Kaizen post of the year 2025 is here! With the new Client Script support for the Notes Related List, you can validate, enrich, and manage notes across modules. In this post, we’ll explore how


                                                                    Manage your brands on social media



                                                                          Zoho TeamInbox Resources



                                                                              Zoho CRM Plus Resources

                                                                                Zoho Books Resources


                                                                                  Zoho Billing Resources

                                                                                    Zoho Projects Resources


                                                                                      Zoho Sprints Resources


                                                                                        Qntrl Resources


                                                                                          Zoho Creator Resources



                                                                                              Zoho CRM Resources

                                                                                              • CRM Community Learning Series

                                                                                                CRM Community Learning Series


                                                                                              • Kaizen

                                                                                                Kaizen

                                                                                              • Functions

                                                                                                Functions

                                                                                              • Meetups

                                                                                                Meetups

                                                                                              • Kbase

                                                                                                Kbase

                                                                                              • Resources

                                                                                                Resources

                                                                                              • Digest

                                                                                                Digest

                                                                                              • CRM Marketplace

                                                                                                CRM Marketplace

                                                                                              • MVP Corner

                                                                                                MVP Corner









                                                                                                  Design. Discuss. Deliver.

                                                                                                  Create visually engaging stories with Zoho Show.

                                                                                                  Get Started Now


                                                                                                    Zoho Show Resources

                                                                                                      Zoho Writer

                                                                                                      Get Started. Write Away!

                                                                                                      Writer is a powerful online word processor, designed for collaborative work.

                                                                                                        Zoho CRM コンテンツ




                                                                                                          Nederlandse Hulpbronnen


                                                                                                              ご検討中の方