-
Notifications
You must be signed in to change notification settings - Fork 55
Description
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.