Creating a Gmail integration using custom connectors

Creating a Gmail integration using custom connectors

Hello everyone!

Greetings from Deluge. Following up on our series aimed at exploring the capabilities of Deluge, today we'll take an in-depth look into the Deluge custom connections that can be created across Zoho services.

Deluge boasts an extensive range of over 260 built-in integrations spanning more than 35 Zoho services. These integrations streamline data access and modification with these services, from a single point in Zoho, without having to toggle between services. However, we understand that the needs of our users vary widely, and sometimes existing integrations may not cover every scenario.

That's where custom connections come in. Think of them as the Swiss Army Knife of integrations, enabling connections with hundreds of services—such as Gmail and Outlook—and seamlessly integrating them with your favorite Zoho services. With custom connections, you have the power to build your own integrations with virtually any third-party service and tailor them to meet your requirements. Moreover, since the custom connections use the OAuth 2.0 authentication mechanism, you're getting best-in-class security while integrating with third-party services.

What are connections? 
Before we dive into the details of custom connectors, let's take a glimpse at what connections are in Deluge. Connections are a means to connect your Zoho account and any third-party accounts you wish to integrate with. Once a connection is created and connected, you can use it in Deluge integration tasks or invokeURL scripts to perform REST operations on the target service from the required Zoho service. For more information, visit our Connections help doc.
  
Use case 
Assume the sales team of an organization uses Zoho CRM for managing leads, customer retention, and customer acquisition, and uses Gmail for communication purposes, like following up with potential clients via email.   While the system works as is, it's time-consuming and prone to error, so an integration between Gmail and Zoho CRM is necessary to improve efficiency.

A custom connection to your Google account will enable you to sync your Zoho CRM and Google accounts, allowing you to perform actions related to your Google account from Zoho CRM. For example, you can invoke the connection using the invokeURL task in Zoho CRM and send an email to your leads from your Gmail address.

Steps to configure the Google custom connection

Configuration video


Configuration steps
Creating Google OAuth credentials
  1. Visit https://console.cloud.google.com/.
  2. Click the dropdown and choose the required project.
  3. Navigate to the hamburger menu on the left and click APIs and services -> Library.
  4. You'll be taken to the API library page. Navigate to the Google Workspace section and click Gmail API.
  5. Next, click Enable on the Gmail API product details page.
  6. In order to use this API, you'll need to create credentials. Click CREATE CREDENTIALS.
  7. On the Create credentials page, choose Gmail API in the Select an API dropdown and User Data under the What data will you be accessing? section. Click Next.
  8. Next, on the OAuth consent screen, enter the App name, User support email, and Developer contact email address. Then click Save and Continue.
  9. Next, under the Scopes section, click the ADD OR REMOVE SCOPES button.
  10. In the Update selected scopes pane, search and select the gmail.readonly scope. Click Update, and then click Save and continue.


  11. Now, under the OAuth Client ID section, choose Web application in the Application type dropdown. Then name your app.


  12. Enter https://deluge.zoho.com/delugeauth/callback as the Authorized redirect URI.
  13. Click Create and download your credentials. This Client ID and others will be required later, while creating a connection in Zoho CRM.
  14. Navigate to the OAuth consent screen and click Add users under Test users. Enter the user's email address and click Save.
Creating a custom connector for Gmail
  1. Now the action shifts to Zoho CRM. Navigate to crm.zoho.com -> Settings -> Connections.
  2. Choose Custom Services and click Create Service.
  3. On the Create Service screen, choose OAuth 2.0 as the Authentication type and Header as the Parameter.
  4. Enter the Client ID, Client Secret, and Authorize URL generated from Google as shown in step 12 above.
    Tip: Having the Offline access type will allow your application to refresh tokens even when the user is not actively using the application.
  5. Then enter https://oauth2.googleapis.com/token as the Access token URL and Refresh token URL.
  6. Specify the necessary scopes like read and create, etc. and then click Create Service.
  7. On the next page, click Create Connection. Give the connection name and choose the scopes. Then click Create and Connect.
  8. Finally, authenticate the connection on the Google accounts page. Your custom connection will be created, and the two services can be integrated!
Now that the connection between Zoho CRM and Gmail has been established, you can use the invokeURL task to access and modify data in Gmail using the different APIs.

Sample
You can use the below code in invokeURL task to get the latest emails from Gmail.

userId = "emailaddress@gmail.com";
get_gmail = invokeurl
[
url: "https://gmail.googleapis.com/gmail/v1/users/"+userId+"/messages"
type: GET
connection : "connectionname"
];
messageID = get_gmail.get("messages").get(0).get("id");

get_gmail_withID = invokeurl
[
url: "https://gmail.googleapis.com/gmail/v1/users/"+userId+"/messages/"+messageID
type: GET
connection : "connectionname"
];

Content_of_the_mail = get_gmail_withID.get("snippet");
info "Mail Content : " + Content_of_the_mail;

gmail_values = get_gmail_withID.get("payload").get("headers");
for each headers in gmail_values
{
if ( headers.get("name") == "Subject" )
{
info "Subject of the Mail : " + headers.get("value");
}
if ( headers.get("name") == "From" )
{
info "From Address : " + headers.get("value");
}
}

References

----

And that's a wrap for today! We hope you found this post informative and start using custom connections to experience the full capabilities of Deluge and Zoho.

Kindly let us know if you have any questions, feedback, or suggestions in the comments, or write to us at support@zohodeluge.com!
 
Regards,
The Deluge Team
    • Recent Topics

    • Marketing Automation Emails Going to Spam

      Google is trapping all the marketing automation emails in spam. My domain has a perfect reputation and it looks like Zoho has a low reputation which is sending it to spam. When I pull the email out of spam and click on a link in the email, I get this
    • I'm getting an "Invalid_scope" error, even though I used an access token generated with the correct scope.

      I'm getting an "Invalid_scope" error, even though I used an access token generated with the correct scope. Here’s what I did in Postman: Generated the code to create an access token using the following URL: https://accounts.zoho.eu/oauth/v2/auth?scope=ZohoCampaigns.contact.UPDATE&client_id=<client_id>&response_type=code&access_type=offline&redirect_uri=https://1882-2-26-193-161.ngrok-free.app
    • Customer can't comment on SO or Invoice

      Hi I just saw that my customers are not able to submit a comment either on invoices or sales order. What happens if my customer hits submit is just nothing. only a red line appears on top of the page which probalby indicates an error. I'm not able to
    • Convert Request to Forum Topic

      I know you can convert a forum topic to a request and a request to a solution in the knowledge base, but how do you convert a request to a forum topic?  Is this possible?  If not is this a feature coming down the pipe in the near future? Thanks!
    • Integration of Business Hours in Email Templates

      Dear Zoho Desk Team, We would like to propose a feature enhancement to Zoho Desk that would greatly improve the utility of the Business Hours settings and streamline communication with our clients. Feature Request: Integration of Business Hours in Email
    • Send To Zoho Sign not Showing

      The button send to Zoho sign is not showing on my Zoho CRM . Is there additional steps I need to take after installing Zoho Sign to CRM ?
    • Vivaldi will not open the Zoho Mail app when I click a email link in the browser

      I'm running Vivaldi on Arch with the Plasma desktop and have under default applications Zoho Mail set as my default email client. Whenever I click a email link in Vivaldi I get the below when it should be launching Zoho. Any ideas on rectifying this issue?
    • Zoho Creator Upcoming Updates - December 2024

      Hi all, We're excited to be back with the latest updates and developments on the Creator platform. Here's what we're going over this month: Deluge AI assistance Rapid error messages in Deluge editor QR code & barcode generator Expandable RTF and multi
    • Zoho Sign / Prefill By You - Editable by Them!

      Zoho Sign seems to have two field options available - an empty field for signer(s) to complete or a field that has been prefilled by you, that becomes read only once sent.  What I would like is an option on the pre-filled by you fields, to leave them
    • How to transfer all my mails from Zoho to Gmail or Office 365

      is there any option to move my emails from zoho to gmail or office 365. i would like to export more than 25k emails from zoho to office 365 or gmail. can anyone help me to guide properly. this will help me to access my emails easily i have both account and can easily  do it with office 365 or gmail. i want two options. direct from zoho to office 365  or exported eml files from zoho to gmail. please suggest me both if possible 
    • Is the Contacts sync between Campaigns and CRM bi-directional?

      Is the Contacts sync between Campaigns and CRM bi-directional?
    • Task does not syncing to google calendar shedual

      Hi why does the tasks activities do not syncing with the google calendar like the event option does?
    • Bug with Zobot Human transfer

      I have configured the brand, the operator, and the Zobot in Spanish. However, no matter what I do, it always says "YES" instead of "Sí" or "Sure, why not " instead of "Claro, ¿por qué no?" when asking if the user wants to contact a human operator. The
    • Error AS101 when adding new email alias

      Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
    • This mobile number has been marked spam. Please contact support.

      Hi Support, Can you tell me why number was marked as spam. I have having difficult to add my number as you keep requesting i must use it. My number is +63....163 Or is Zoho company excluding Philippines from their services?
    • email address autocomplete

      Is there a way to eliminate certain addresses from showing up in auto complete when entering an address? Many old and unused addresses currently show up, many of which I would like to get rid of. Thanks
    • Something went wrong. One or more fields contain errors

      I am getting this error but there is no way to debug what field is causing the issue . I have over 100 fields. Everything was working fine and then i fixed some fields that should have the same field names but had a typo and i am getting this error. It
    • Integrating Zoho Desk Instances from two separate organizations

      Is it possible to integrate Zoho Desk with an instance from another organization? For example, creating a ticket in one organization can cause the creation of a ticket in the second organization? Or certain tickets from one organization be viewable by
    • Send Whatsapp with API including custom placeholders

      Is is possible to initiate a session on whatsapp IM channel with a template that includes params (placeholders) that are passed on the API call? This is very usefull to send a Utility message for a transactional notification including an order number
    • Knowledge base bug - Error: Article couldn't be updated.

      It took me a while to figure this out, truly one of the most irritating bugs in Zoho. I hope you find this information helpful. When using the knowledge base to create articles, make sure your keywords are in lowercase and separated by commas. Otherwise,
    • Is this possible with Campaigns?

      My company is currently moving CRM's from Monday to Zoho One. Currently, our marketing lead process is send out 7 sms messages over 14 days if the lead is in a certain status. If we don't get a response the lead is put into a "Closed" status. Do we buy
    • How to view two portals (Zoho CRM & Zoho Books) in single login

      Hello there, I need to create a portal access for the Customers. Customer data present in two applications namely Zoho CRM & Zoho Books. My requirement is to show the two different portals(Zoho CRM Portal & Zoho books Portal) in single login. I could
    • Invoice status on write-off is "Paid" - how do I change this to "Written off"

      HI guys, I want to write off a couple of outstanding invoices, but when I do this, the status of the invoices shows as "Paid". Clearly this is not the case and I need to be able to see that they are written off in the customer's history. Is there a way
    • Zoho Flow or Schedules

      I have a process where we text our leads 7 times over a 14 day with different content for each text. I created one flow in Zoho Flow to do this, but wondering if there is a more efficient way to accomplish this via Schedules. It goes on for 6 more times
    • Updating Bounced Contacts in Campaigns to the CRM

      The article explains how to update Opt-outs from Campaigns to CRM, but not bounces. While Campaigns will automatically remove any bounced emails from future campaigns, is there a process by which a bounce will update or make a notification in the CRM
    • Bandwidth, voice and poor video

      Dear Team, The webinar has made things quite easy and convenient for educators around the world. We are an art & culture-based organization where students and researchers are our major audience.  While using the Zoho webinar platform, we have observed that the audio lags and the video is of poor quality and often freezes. Some participants don't hear what is being spoken.  We also found that even a slightly slow internet connection disrupts the webinar while it should be working well even on lower
    • No Hope for Zoho Meeting

      Zoho Meeting is just the poorest meeting app I've come across in a long time. The support sucks too. I called to see if there was anything that could be done on the backend and while I was on a test meeting with support the video was lagging and freezing
    • Zoho books and venmo

      Hi, Is there a way to hook Venmo into zoho books? I have a Venmo business account and want to be able to sync that. I know you can do it with the paypal integration but I dont want to use paypal for the fees and that doesnt allow me use/integrate my current
    • Associate Email API Internal Error

      I am trying to associate an already existing email within a function using the Related Emails API. To provide more context, I also have admin permissions and have ensured that the fields are correct and that I have admin permissions when associating the
    • Contacts Don't Always Populate

      I've noticed that some contacts can easily be added to an email when I type their name. Other times, a contact doesn't appear even though I KNOW it is in my contact list. It is possible the ones I loaded from a spreadsheet are not an issue and the ones
    • 550 5.4.6 Unusual sending activity detected. Please try after sometime. <a href=https://www.zoho.com/mail/help/usage-policy.html target=_blank>Learn more.</a>

      Please help me with this. Sending of mails is blocked.
    • Segmenting Contacts Based on Product Purchased

      I am trying to organize our main Marketing Automation email list in a way that segments contacts based on products they have purchased (for example in this case it is 3 different products). To my knowledge, this would require the sync from Zoho CRM to
    • Update a lookup field in CRM from Creator using deluge

      I have a Creator form that creates a new account. When it creates the new account in the Accounts Module, I need it to also populate the Parent Account, which is a lookup field coming from the Module Parent Accounts, field Parent Account Name. I have
    • Urgent Assistance Needed with DKIM Verification

      Hi, I have been trying to verify the DKIM for the past month using your instructions as well as other resources. Unfortunately, I have not been able to resolve the issue, and it remains persistent. I need to address this problem as soon as possible so
    • Someone made ActiveSync and Autodiscover work, with iOS and macOS

      Hi, I'm trying to set this up for the fifth day now and I"m not getting anywhere. Weird thing is that somewhen in the beginning, I had it working, when I still had VirtualServers and certificates mixed up. But now it's all fine, I have the XML file from
    • How do I attach tasks from one task to other tasks in the same project

      How do I attach tasks from one task to other tasks in the same project
    • Not able to change colors help center

      Hi. How can I change the orange color in the help center? You can change everything besides this font color And how can I remove the part on the bottom?
    • Zoho Books Invoice Salesperson: requires ID but there is no "Fetch salesperson" action

      Hi, I am trying to attach a Salesperson to a Zoho Books invoice. In Zoho Flow, the salesperson field required an ID. However, I only have the salesperson name, I need to fetch salesperson by name and then provide the ID. There is no option to fetch salesperson...
    • Change format of quantity format

      Hi,  I would like to change the qunatity format from 1,00 to 1.  Is this possible?   thanks!
    • Ticket Views: filter criteria -> dynamic date values in relation to the current date

      Hello all, It would be very helpful if you could build custom views in such a way that you do not have to adjust the criteria daily or at whatever interval in order to change the fixed date value as needed. For example, I would like to create a view that,
    • Next Page