feat(service): Add Nylas API v3 email notification service#1003
Open
mqasimca wants to merge 2 commits intonikoksr:mainfrom
Open
feat(service): Add Nylas API v3 email notification service#1003mqasimca wants to merge 2 commits intonikoksr:mainfrom
mqasimca wants to merge 2 commits intonikoksr:mainfrom
Conversation
Add comprehensive Nylas API v3 integration to the notify library, enabling email notifications through Nylas's communication platform. This implementation uses direct REST API calls to Nylas v3 endpoints, as there is no official Go SDK available for v3. ## New Files - service/nylas/nylas.go - Core service implementation with full v3 API support - service/nylas/doc.go - Package documentation with usage examples - service/nylas/nylas_test.go - Comprehensive test suite with mock HTTP client - service/nylas/compile_check.go - Compile-time interface verification - service/nylas/example_test.go - Example usage demonstrations ## Features - ✓ Direct REST API integration with Nylas v3 (no external SDK dependencies) - ✓ Multiple recipient support via AddReceivers() - ✓ HTML and plain text email formatting (BodyFormat()) - ✓ Regional API support (US/EU) via WithBaseURL() - ✓ Custom HTTP client injection for testing (WithHTTPClient()) - ✓ Context-aware operations with proper cancellation support - ✓ Production-ready timeout configuration (150s for Exchange servers) - ✓ Comprehensive error handling with detailed Nylas API error messages - ✓ Grant ID-based authentication (Nylas v3 authentication model) ## Testing - 7 comprehensive test cases covering all scenarios - Mock HTTP client for isolated unit testing - Tests for success cases, error handling, context cancellation - All tests passing with full coverage of core functionality - Successfully tested with live Nylas API v3 endpoint ## Implementation Details The service follows the established notify library patterns: - Implements the notify.Notifier interface - Consistent API design matching other services (SendGrid, Mailgun) - No breaking changes to existing code - Zero external dependencies beyond Go standard library ## API Reference https://developer.nylas.com/docs/v3/email/send-email/ Closes integration gap for Nylas API v3 support in the notify ecosystem.
…tion Add support for Nylas API regional endpoints (US and EU) with a new NewWithRegion constructor that provides type-safe region selection. Changes: - Add Region type with RegionUS and RegionEU constants - Add NewWithRegion() constructor for region-specific initialization - Define BaseURLUS and BaseURLEU constants for regional endpoints - Default to US region for backward compatibility - Add comprehensive README.md with setup guide and usage examples - Update doc.go with regional configuration examples - Add test coverage for NewWithRegion with all region variants The README includes: - Step-by-step Nylas account setup instructions - Grant ID creation and authentication flow explanation - Usage examples for all features (basic, HTML/plain text, regions) - Troubleshooting guide for common issues - Environment variable recommendations for security This improves the developer experience by providing clear documentation for getting started with Nylas v3 API and enables users in the EU region to use the appropriate API endpoint with a clean, type-safe API.
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.
Add comprehensive Nylas API v3 integration to the notify library, enabling email notifications through Nylas's communication platform. This implementation uses direct REST API calls to Nylas v3 endpoints, as there is no official Go SDK available for v3.
New Files
Features
Testing
Implementation Details
The service follows the established notify library patterns:
API Reference
https://developer.nylas.com/docs/v3/email/send-email/
Closes integration gap for Nylas API v3 support in the notify ecosystem.
Description
Motivation and Context
How Has This Been Tested?
Screenshots / Output (if appropriate):
Types of changes
Checklist: