Skip to content

Add send, reply, and draft capability #2

Description

@swinton

Currently the REPL is read-only (plus batch delete). Adding compose/reply/draft support would make it useful for automation, not just inspection.

Proposed API

// Compose a new message
await send({ to: 'alice@example.com', subject: 'Hello', body: 'Hi there' })

// Reply to an existing message
await reply('1883a5111e8ef47c', 'Thanks!')

// Save a draft
await draft({ to: 'alice@example.com', subject: 'WIP', body: 'Draft body' })

Notes

  • users.messages.send
  • users.drafts.create
  • Messages need to be RFC 2822 formatted and base64url-encoded before sending
  • Reply should set In-Reply-To and References headers and attach to the correct threadId
  • Requires adding https://www.googleapis.com/auth/gmail.send or https://mail.google.com/ to scopes (the latter is already present)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions