Last active
June 14, 2019 03:26
-
-
Save JaiParakh/fc68f614ab6a9b059020d8c4f24771ee 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
//Send the message to specified receiver. | |
sendMail(encodedMessage){ | |
this.gmail.users.messages.send({ | |
userId: this.me, | |
resource: { | |
raw: encodedMessage, | |
} | |
}, (err, result) => { | |
if(err){ | |
return console.log('NODEMAILER - The API returned an error: ' + err); | |
} | |
console.log("NODEMAILER - Sending email reply from server:", result.data); | |
}); | |
} | |
//Saves the draft. | |
saveDraft(encodedMessage){ | |
this.gmail.users.drafts.create({ | |
'userId': this.me, | |
'resource': { | |
'message': { | |
'raw': encodedMessage | |
} | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment