Created
June 20, 2019 06:59
-
-
Save JaiParakh/97e2e9ae90f482d78091e6c75bb2775b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//THis function checks for mails sent by medium. | |
//We attatch a query parameter to the request body. | |
checkForMediumMails(){ | |
var query = "from:noreply@medium.com is:unread"; | |
this.gmail.users.messages.list({ | |
userId: this.me, | |
q: query | |
}, (err, res) => { | |
if(!err){ | |
//mail array stores the mails. | |
var mails = res.data.messages; | |
//We call the getMail function passing the id of first mail as parameter. | |
this.getMail(mails[0].id); | |
} | |
else{ | |
console.log(err); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment