Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@templth
Copy link
Contributor

@templth templth commented Sep 6, 2019

Context

The check_inbox function doesn't accept an options whereas the _get_recent_email has. This is annoying since this prevents from passing the include_bodyoption to get the content of the email.

Feature

The updates allow cypress tests to do something like that:

  on("task", {
    "gmail:check": async args => {
      const { from, to, subject } = args;
      const email = await gmail.check_inbox(
        path.resolve(__dirname, "credentials.json"), // credentials.json is inside plugins/ directory.
        path.resolve(__dirname, "gmail_token.json"), // gmail_token.json is inside plugins/ directory.
        subject,
        from,
        to,
        10,                                          // Poll interval (in seconds)
        30                                           // Maximum poll interval (in seconds). If reached, return null, indicating the completion of the task().
       { include_body: true }
      );
      return email;
    },

@templth templth force-pushed the feature/checkinbox-with-email-body branch from b0eec10 to a0d8d19 Compare September 6, 2019 09:27
Copy link
Owner

@levz0r levz0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @templth,

Can you please update README.md file to reflect the change?

@templth
Copy link
Contributor Author

templth commented Nov 13, 2019

@levz0r sorry for the long answer! I updated the readme to add the options parameter for the check_inbox method. Feel free to tell me if it's okay for you. Thanks!

@levz0r levz0r merged commit 779cf14 into levz0r:master Nov 15, 2019
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

Successfully merging this pull request may close these issues.

2 participants