Skip to content

Instantly share code, notes, and snippets.

@ajdinmust
Created August 24, 2022 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajdinmust/288a97eee7f910f3a6535e601e694558 to your computer and use it in GitHub Desktop.
Save ajdinmust/288a97eee7f910f3a6535e601e694558 to your computer and use it in GitHub Desktop.
setupNodeEvents(on, config) {
on("task", {
"gmail:check": async (args) => {
const { from, to, subject } = args;
const email = await gmail.check_inbox(
path.resolve(__dirname, "credentials.json"),
path.resolve(__dirname, "token.json"),
{
subject: subject,
from: from,
to: to,
include_body: true,
wait_time_sec: 10,
max_wait_time_sec: 30,
}
);
return email;
},
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment