Commit graph

20 commits

Author SHA1 Message Date
Max
2993b0b946 feat(messenger): enhance dynamic SMTP resolution and identity handling
- Implemented dynamic SMTP provider resolution based on user/team context, improving email sending capabilities.
- Updated the Send and SendT methods to utilize identity information from the context for dynamic provider selection.
- Refactored cloud encryption and decryption methods to delegate to the setting package, streamlining cryptographic operations.
- Enhanced team invitation email sending to include identity context, ensuring accurate user/team information is used.
- Removed obsolete crypto helper functions, simplifying the codebase and improving maintainability.
2026-05-04 18:15:21 +08:00
Max
8d88042489 Implement Attachment Support in Email Messaging
- Enhanced the `mailer` provider to support email attachments, including both regular and inline attachments.
- Updated the `buildMessage` method to handle multipart email formats for messages with attachments.
- Added new tests for attachment handling in `mailer_test.go` and `mailgun_test.go`, ensuring comprehensive coverage for single, multiple, and inline attachments.
- Revised `TODO.md` to reflect the completion of attachment support across email providers, confirming that all major providers now support this feature.
2026-01-18 17:05:24 +08:00
Max
8aa373b969 Refactor Logging in Mail Receiver to Use Structured Logging
- Replaced standard log statements with structured logging using the kun/log package for improved log clarity and consistency.
- Updated log messages in the MailReceiver to include contextual information, enhancing the ability to trace issues during email processing.
- This change aims to provide better insights into the email receiver's operations and error handling.
2025-12-24 09:51:05 +08:00
Max
ffbe10f862 Update template tests to align with actual template variables and improve consistency
- Modified test data in template tests to include 'invitation_link' and 'expires_at' fields, ensuring alignment with the actual template structure.
- Changed message type verification from "mail" to "email" for clarity and accuracy.
- Enhanced comments for better understanding of test data relevance.
2025-10-09 15:43:57 +08:00
Max
03ecf96b51 Enhance messenger service with optional message type support for template sending
- Updated SendT, SendTWithProvider, SendTBatch, and SendTBatchMixed methods to accept an optional message type parameter, allowing for more flexible template usage.
- Refactored provider implementations for Mailgun, Twilio, and Mailer to accommodate the new message type parameter in their SendT and SendTBatch methods.
- Improved error handling for template retrieval and provider configuration, ensuring clearer feedback in case of issues.
- Added tests to validate the new functionality and ensure compatibility across different message types.
2025-10-09 12:11:54 +08:00
Max
bd463b0ec5 Refactor template tests to improve readability and consistency
- Cleaned up whitespace in debug, load, and walk test files for better formatting.
- Enhanced logging statements for clarity during template loading and walking tests.
- Standardized test structure to improve maintainability and readability across template-related tests.
2025-10-08 09:22:28 +08:00
Max
ec8b6c336b Enhance messenger service with template support for message sending
- Introduced template loading functionality during messenger initialization, allowing for dynamic message templates.
- Added SendT, SendTWithProvider, SendTBatch, and SendTBatchMixed methods to the Service for sending messages using templates.
- Updated provider implementations for Mailgun, Twilio, and Mailer to support template-based message sending.
- Enhanced the Provider interface to include optional template methods, improving flexibility and usability across providers.
2025-10-08 09:21:57 +08:00
Max
f0d56b91ad Update Makefile to exclude 'twilio' from test folder and clean up whitespace in mailer and mailgun provider files 2025-09-28 16:13:29 +08:00
Max
436d101cf3 Add GetAllProviders method and related tests for provider information retrieval
- Implemented GetAllProviders method in the Service to return all registered providers.
- Added TestGetAllProviders to validate the functionality, ensuring providers have required attributes and are unique.
- Enhanced GetPublicInfo method in provider implementations to return structured public information.
- Updated OpenAPI handlers to include endpoints for retrieving provider information, improving API usability.
2025-09-28 16:00:35 +08:00
Max
0505adf003 Refactor messenger service to enhance webhook processing and remove deprecated methods
- Implemented TriggerWebhook method to handle incoming webhook requests for various providers, utilizing gin.Context for improved integration.
- Removed the deprecated Receive method from the mailer provider and related functions, streamlining the codebase.
- Updated tests to reflect changes in webhook handling and provider interactions, ensuring compatibility with new implementations.
- Enhanced error handling and logging for webhook processing, improving overall reliability and clarity.
2025-09-28 15:27:20 +08:00
Max
ffc666c4de Enhance messenger service with message handler registration and webhook processing
- Introduced OnReceive method to register multiple message handlers for processing received messages.
- Added RemoveReceiveHandler method to unregister specific message handlers.
- Implemented TriggerWebhook method to process incoming webhook data and trigger registered handlers.
- Updated existing tests to reflect changes in provider types from 'smtp' to 'mailer' for consistency.
2025-09-28 10:00:38 +08:00
Max
1843a64ff5 Update dependencies and enhance mailer functionality
- Bump Go version to 1.24.0 and update toolchain to 1.24.3 for improved performance and compatibility.
- Add new dependencies for IMAP and SASL support, enhancing email handling capabilities.
- Refactor messenger service to integrate a new mailer provider, replacing the deprecated SMTP provider.
- Implement automatic mail receiver startup for mailer providers, improving message handling efficiency.
- Update GitHub Actions workflows to include IMAP server configurations for testing email reception.
2025-09-28 09:33:36 +08:00
Max
09ec6edac3 Enhance Twilio provider tests and configurations for improved SMS functionality
- Added TWILIO_TEST_PHONE environment variable to GitHub Actions workflows for better test configuration.
- Updated Twilio SMS test cases to utilize the new test phone number, improving test reliability.
- Implemented separate test cases for SMS sending using both Auth Token and API Key authentication methods.
- Enhanced existing tests to skip execution if required credentials are not configured, ensuring clearer test outcomes.
- Refactored benchmark tests for SMS sending to support both authentication methods, optimizing performance evaluation.
2025-09-27 08:41:42 +08:00
Max
d0964c942d Refactor Twilio provider methods to include context support
- Updated method signatures for sendSMS, sendWhatsApp, and their respective recipient functions to accept context.Context as a parameter.
- Modified request handling in sendTwilioRequest to utilize context, improving request management and error handling.
- Enhanced overall functionality and maintainability of the Twilio provider by integrating context support.
2025-09-26 19:01:05 +08:00
Max
fecbc87ba8 Update Mailgun test to validate delivery time format with timezone offset
- Modified the test for scheduled email delivery to assert that the delivery time includes a timezone offset in the RFC1123Z format.
- Replaced the previous check for "GMT" with a regex assertion to ensure compliance with the expected format.
2025-09-26 18:44:11 +08:00
Max
ae8efd247a Refactor SMTP provider implementation for improved clarity and functionality
- Renamed SMTPProvider to Provider for consistency across messenger providers.
- Updated method signatures to reflect the new Provider type.
- Added extractEmailAddress function to handle email address extraction from formatted strings.
- Enhanced sendEmail and sendWithTLS methods to support context and improve error handling.
- Refactored message building and sending logic for better maintainability.
2025-09-26 18:37:37 +08:00
Max
9438c6831a Refactor messaging service configurations for improved CI integration
- Enhanced GitHub Actions workflows by refining Mailgun, SMTP, and Twilio configurations for better unit and PR testing.
- Streamlined environment variable management for email and SMS services, ensuring consistent and secure credential handling.
- Updated related tests to validate the new configuration setup, improving overall reliability in communication functionalities.
2025-09-26 18:16:56 +08:00
Max
c9917f8193 Enhance messenger functionality with context support and environment variable resolution
- Added context support to Send and SendBatch methods across all messenger providers (Twilio, Mailgun, SMTP).
- Implemented environment variable resolution in provider configurations to enhance flexibility.
- Updated Load function in the engine to include messenger loading, ensuring all components are initialized properly.
- Refactored related tests to validate new context handling and configuration parsing, improving overall robustness.
2025-09-26 17:39:10 +08:00
Max
d12ce099c3 Add API Key authentication support in Twilio provider
- Introduced optional API Key and API SID fields for enhanced authentication.
- Updated validation logic to require either an auth token or both API SID and API Key.
- Modified request handling to prioritize API Key authentication over auth token, improving security and flexibility.
2025-09-26 16:34:23 +08:00
Max
9e0afa3f42 Implement team member invitation expiration handling
- Added functionality to manage expiration of member invitations, ensuring that outdated invitations are automatically invalidated.
- Updated invitation-related data structures to include expiration timestamps for better tracking.
- Enhanced the invitation workflow by implementing checks for expired invitations during member management operations.
- Refactored related tests to cover new expiration logic, ensuring robust validation of invitation handling.
2025-09-25 10:33:35 +08:00