feat: Enhance email configuration with contact and store name fields #53
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.
This pull request introduces several enhancements to email notifications and order status management, along with configuration updates and testing improvements. The changes primarily focus on adding support for tracking information in order shipment emails, refining configuration handling, and updating documentation to reflect the new features.
Email Notifications Enhancements:
SendOrderShippedinSMTPEmailServiceto send order shipment emails with optional tracking information. This includes updates to email templates and debug logging for tracking URLs. (internal/infrastructure/email/smtp_email_service.go)handleEmailsForOrderStatusChangefunction inOrderUseCaseto send shipment emails when the order status changes to "shipped". It now supports tracking information. (internal/application/usecase/order_usecase.go)Configuration Updates:
EMAIL_CONTACT_ADDRESS,STORE_NAME) to.env.examplefor better customization of email sender details and store name. (.env.example) [1] [2]EmailConfigstruct inconfig.goto includeContactEmailandStoreNamefields, and modified theLoadConfigfunction to handle defaults and environment variables for these fields. (config/config.go) [1] [2]Documentation Improvements:
RESTAPI.mdandorder_api_examples.mddocumentation to include details about updating order status with tracking information, valid statuses, and email notification features. (docs/RESTAPI.md,docs/order_api_examples.md) [1] [2]Testing Enhancements:
config_test.goto verify default and custom values forContactEmailandStoreNamein the configuration. (config/config_test.go)Codebase Simplification:
SMTPEmailServiceto useStoreNameandContactEmailfrom the configuration instead of hardcoded values. (internal/infrastructure/email/smtp_email_service.go) [1] [2]