feat(email): auto-detect inbox provider for transactional send#17
Merged
qasim-nylas merged 1 commit intomainfrom Feb 3, 2026
Merged
feat(email): auto-detect inbox provider for transactional send#17qasim-nylas merged 1 commit intomainfrom
qasim-nylas merged 1 commit intomainfrom
Conversation
Automatically detect when a grant uses the Nylas Inbox provider and
route email sends through the domain-based transactional endpoint
instead of the grant-based endpoint.
Changes:
- Add TransactionalClient port interface for domain-based email sending
- Implement SendTransactionalMessage adapter for POST /v3/domains/{domain}/messages/send
- Add ExtractDomain helper to parse domain from email addresses
- Update email send command to auto-detect provider type:
- Inbox provider: uses POST /v3/domains/{domain}/messages/send
- Other providers (Google/Microsoft/IMAP): uses POST /v3/grants/{id}/messages/send
- Add mock and demo client implementations
- Add comprehensive unit tests
User experience remains unchanged - the CLI automatically selects
the correct endpoint based on the grant's provider type.
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
Automatically detect when a grant uses the Nylas Inbox provider and route email sends through the domain-based transactional endpoint instead of the grant-based endpoint.
User Experience: No changes required - the CLI automatically selects the correct endpoint based on the grant's provider type.
Changes
TransactionalClientfor domain-based email sendingSendTransactionalMessageforPOST /v3/domains/{domain}/messages/sendExtractDomain()to parse domain from email addresses (e.g.,info@qasim.nylas.email→qasim.nylas.email)Files Changed
internal/ports/transactional.gointernal/ports/nylas.gointernal/adapters/nylas/transactional.gointernal/adapters/nylas/mock_transactional.gointernal/adapters/nylas/demo_transactional.gointernal/adapters/nylas/transactional_test.gointernal/cli/common/string.gointernal/cli/common/string_test.gointernal/cli/email/send.goTest Plan
ExtractDomainhelperSendTransactionalMessageadaptermake ci)