Skip to content

Instantly share code, notes, and snippets.

@JaiParakh
Created June 20, 2019 06:59
Show Gist options
  • Save JaiParakh/97e2e9ae90f482d78091e6c75bb2775b to your computer and use it in GitHub Desktop.
Save JaiParakh/97e2e9ae90f482d78091e6c75bb2775b to your computer and use it in GitHub Desktop.
//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