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

Tooling around draft + send workflow #158

Open
hadley opened this issue Aug 5, 2021 · 0 comments
Open

Tooling around draft + send workflow #158

hadley opened this issue Aug 5, 2021 · 0 comments
Labels
feature a feature request or enhancement

Comments

@hadley
Copy link
Member

hadley commented Aug 5, 2021

It's really reassuring to first generate a drafts and then send those drafts. It would be nice to have a little tooling around this workflow, particularly if you're sending a few hundred emails and want to be able to easily resume if anything bad happens part way through.

At a minimum, I think this just needs gm_create_drafts() (takes a list of mimes) and gm_send_drafts() (takes return value of gm_create_drafts()). Empirically it also seems like you need to sleep between each call to gm_send_draft() in order to avoid this error:

{
  "error": {
    "code": 400,
    "message": "Precondition check failed.",
    "errors": [
      {
        "message": "Precondition check failed.",
        "domain": "global",
        "reason": "failedPrecondition"
      }
    ],
    "status": "FAILED_PRECONDITION"
  }
}

(Sleeping for 1 second worked for me; I also tried 0.1 and 0.5 which weren't long enough)

This means it's likely to take some time to send all the drafts, so it would also be nice to display a progress bar. Creating the drafts also seems relatively slow, so a progress bar would help there.

@jennybc jennybc added the feature a feature request or enhancement label May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants