[cloud-workers, isomorphic-core] Implement the SendRemindersWorker

Summary:
Process reminders metadata and send the reminder email if there
haven't been any replies. Checking for replies involves checking
each of the folders in `folderImapNames` for messages that are in
reply to the messages in `messageIdHeaders`.

Test Plan: manual

Reviewers: khamidou, juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3958
This commit is contained in:
Halla Moore 2017-02-16 18:45:03 -08:00
parent 1e0ae4fb03
commit a9f3033907

View file

@ -130,6 +130,9 @@ module.exports = (sequelize, Sequelize) => {
}
if (this.provider === 'gmail') {
const {xoauth2} = this.decryptedCredentials();
if (!xoauth2) {
throw new Error("Missing XOAuth2 Token")
}
const {imap_username} = this.connectionSettings;
const token = this.bearerToken(xoauth2);
config.auth = { user: imap_username, xoauth2: token }