Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues on check_inbox example #18

Closed
andreabisello opened this issue Jan 2, 2020 · 0 comments
Closed

issues on check_inbox example #18

andreabisello opened this issue Jan 2, 2020 · 0 comments

Comments

@andreabisello
Copy link

the check_inbox example here https://github.com/levz0r/gmail-tester

const path = require("path");
const gmail = require("gmail-tester");
const email = await gmail.check_inbox(
  path.resolve(__dirname, "credentials.json"), // Assuming credentials.json is in the current directory.
  path.resolve(__dirname, "gmail_token.json"), // Look for gmail_token.json in the current directory (if it doesn't exists, it will be created by the script).
  "Activate Your Account", // We are looking for 'Activate Your Account' in the subject of the message.
  "[email protected]", // We are looking for a sender header which has '[email protected]' in it.
  "<target-email>", // Which inbox to poll. credentials.json should contain the credentials to it.
  10, // Poll interval (in seconds).
  30 // Maximum poll time (in seconds), after which we'll giveup.
  { include_body: true } // If we want to include the body of messages (optional)
  ]
);
if (email) {
  console.log("Email was found!");
} else {
  console.log("Email was not found!");
}

this code wont works, a comma is missing after 30 and the square brackets should to be a brackets after { include_body: true }

const path = require("path");
const gmail = require("gmail-tester");
const email = await gmail.check_inbox(
  path.resolve(__dirname, "credentials.json"), // Assuming credentials.json is in the current directory.
  path.resolve(__dirname, "gmail_token.json"), // Look for gmail_token.json in the current directory (if it doesn't exists, it will be created by the script).
  "Activate Your Account", // We are looking for 'Activate Your Account' in the subject of the message.
  "[email protected]", // We are looking for a sender header which has '[email protected]' in it.
  "<target-email>", // Which inbox to poll. credentials.json should contain the credentials to it.
  10, // Poll interval (in seconds).
  30, // Maximum poll time (in seconds), after which we'll giveup.
  { include_body: true } // If we want to include the body of messages (optional)
  )
);
if (email) {
  console.log("Email was found!");
} else {
  console.log("Email was not found!");
}

also,

in the documentation of check_inbox
https://github.com/levz0r/gmail-tester#check_inboxcredentials_json-token_path-subject-from-to-wait_time_sec--30-max_wait_time_sec--60-options--
subject , from and to are exact match but in the example they aren't, because comments says "IN IT"

@levz0r levz0r closed this as completed in 9dc6fda Jan 24, 2020
levz0r added a commit that referenced this issue Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant