How to call my node.js API when I get an Email in my google inbox?

1k views Asked by At

I am searching for a way to get notified in my Node.js Backend , Everytime when I get an email in my gmail inbox. So that I can show my sales team in frontend that they got a new mail from client. We have their mail read access and are able to fetch email from their inbox. But we are looking for a real time notification in frontend for new mails.

You can also suggest alternate ways if any.

Please Help!

1

There are 1 answers

0
r7r On

This should help

  1. Turn on watching for message events: https://developers.google.com/gmail/api/v1/reference/users/watch
  2. When you get a new incoming messageId (messagesAdded history type) you ask for its information (in full format): https://developers.google.com/gmail/api/v1/reference/users/messages/get