Skip to content

Add checks to gm_create_draft() and/or modify drafts #215

Description

@daren3d

Is it possible to modify a draft?

For example, if one creates this draft,

gm_create_draft(gm_mime(
  #To = "any@one.com",
  From = "you@me.com", 
  Subject = "hello", 
  "how are you doing?"
))

then it cannot be sent because the "To-part" was commented out. That is, gm_send_draft(gm_draft(<id>)) fails with error. Thus, how can one modify this draft and supply the "To-part" so that it can be sent?

Tangently, I would like to suggest that gm_create_draft() checks that the mime object has everything that is required for gm_send_draft(gm_draft(<id>)) to work before creating the draft. Why should gmailr create a draft that it can neither send nor modify?

Even if the previous suggestion is implemented, it is still useful to modify drafts because any draft can be retrieved using gm_draft(<id>), even ones not made by gmailr. Last, I want to admit up-front that I recognize that these requests may be outside the intended scope of gmailr, and I want to commend the team on how easy this package is to use and how useful it is.

Have a great day!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions