TW-4880: route Nylas-managed grants through per-grant send endpoint#65
Merged
qasim-nylas merged 1 commit intomainfrom Apr 29, 2026
Merged
Conversation
Air and the CLI were sending Nylas-provider grants via the domain-based
transactional endpoint, which is a non-archiving relay and injects a
developer-account banner. Switch both to /v3/grants/{id}/messages/send
with From auto-populated, so messages land in the sender's Sent folder
the same way Google/Microsoft sends do.
Also pin Air's compose payload to the page-rendered grant_id so the
visible "from" account matches what the backend uses, regardless of
default-grant resolution drift. And replace the demo-stub refreshEmails()
in settings.js with a real EmailListManager.loadEmails() call.
sourcesoft
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/v3/domains/{domain}/messages/sendendpoint, which is a non-archiving relay and injects a developer-account banner. Switch both to/v3/grants/{id}/messages/sendwithFromauto-populated, so messages land in the sender's Sent folder the same way Google/Microsoft sends do.grant_id(via a newdata-default-grant-idbody attr) so the visible "from" account matches what the backend uses, regardless of default-grant resolution drift.refreshEmails()insettings.jswith a realEmailListManager.loadEmails(currentFolder)call so Air's refresh button actually pulls new mail.Why
Two user-reported bugs:
nylas airwasn't pulling new emails when they arrived — the refresh handler was a placebo.Test plan
make ci-full— all steps pass (fmt, vet, lint, unit, race, security, vuln, CLI regression, agent integration, Air integration)sendMessageForGrantfor managed and standard providersdata-default-grant-idand the send request payload includes itinfo@qasim.nylas.email) — message IDb09369cf-bfdf-491b-8b0f-abccf5eb9031(UUID format = per-grant endpoint), confirmed in Sent folder via APILinked ticket
TW-4880 (Epic: TW-4638 Nylas CLI)