Skip to content

read and write gmail as the google connection's emails collection - #91

Merged
hkonsti merged 4 commits into
hkonsti/google-5-unconfiguredfrom
hkonsti/google-8-gmail
Oct 15, 2026
Merged

hkonsti merged 4 commits into
hkonsti/google-5-unconfiguredfrom
hkonsti/google-8-gmail

Conversation

@hkonsti

@hkonsti hkonsti commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Adds Gmail to the Google integration as an emails collection with the same fields, commands and record shape as the IMAP mailbox's (both now built by emailsCollection in the catalog), under seven new Google actions mapped to gmail.modify (Send also to gmail.send). connections/google/gmail-api.ts covers the Gmail v1 calls and the label-to-folder mapping: Inbox, Draft, Sent, Trash and Spam are labels, and Archive is a search for mail in none of them. records/google-emails.ts is the connector. Record ids are Gmail message ids, except drafts, which are draft-<draft id>. Marking, starring and archiving change labels, Move to Trash is messages.trash (never messages.delete), and mail is sent from the connection's address with MailComposer. Note on quota: Gmail allows 6,000 units per minute per user, and a list page of 50 costs about 1,000 (50 messages.get at 20 units each), so roughly six pages a minute; the docs say so.

Verified live against konsti@varislabs.com through the connector:

  • Listed Inbox (50 plus a second page of 18, no repeats), Sent (25), Archive (4), Trash (1), Spam (10) and a has:attachment search (12). Opened 3 messages.
  • Marked one unread, then read. Starred it, then unstarred it.
  • Archived it and restored it with messages.modify. Trashed it and restored it with messages.untrash; untrash leaves INBOX off, so it was added back. Its labels ended exactly as before.
  • Created a draft and edited its subject only: the id stayed the same, and To and body were kept. Found it in the Draft list and in an unfiltered search under its draft id, deleted it, and opening it then gave not found.
  • Sent one email to self, found it in the Inbox and trashed it.

Stack: on #84; next: Drive writes and Sheets ranges.


Open workspace in Conductor

@hkonsti
hkonsti added this pull request to stack #88 October 13, 2026 22:59
@hkonsti
hkonsti force-pushed the hkonsti/google-8-gmail branch from c4fe545 to d9220f6 Compare October 14, 2026 00:49
@hkonsti
hkonsti force-pushed the hkonsti/google-8-gmail branch 2 times, most recently from 7bd3ab4 to 4dbc6ed Compare October 14, 2026 18:14
…th the same fields and commands as a mailbox's
…, keep a draft's names and html where an edit leaves them as they read, ask gmail again for a message it answers busy, act on a draft by its message id too, and say when a sign-in didn't allow a call
… moves what follows a letter that lowercases to two, read a part's line endings as new lines and an html source's as spaces, and ask a list only for the headers it shows
@hkonsti
hkonsti force-pushed the hkonsti/google-8-gmail branch from f338504 to c9b0f1f Compare October 15, 2026 00:20
@hkonsti
hkonsti merged commit 96439eb into main Oct 15, 2026
4 checks passed
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.

1 participant