feat: Added send email template endpoint #979
Merged
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.
Description
Implemented the functionality to send email templates. This includes robust error handling, retry mechanisms, and detailed logging to ensure that failures in sending emails do not disrupt the user experience. Additionally, ensured that user data is securely saved even if the email sending process fails. Unit tests were added to cover both successful and failure scenarios related to sending email templates.
Related Issue (Link to issue ticket)
Related issue
Motivation and Context
This change is required to provide a reliable mechanism for sending email templates as part of the user interaction workflow. It solves the problem of potential data loss or user experience issues caused by failures in the email sending process. By adding retries and logging, the system becomes more resilient and easier to troubleshoot in case of errors.
How Has This Been Tested?
The implementation was tested using a suite of unit tests that simulate both successful email sending and various failure scenarios (e.g., network issues, invalid email addresses). The tests ensured that errors are handled gracefully, retries are attempted as expected, and logs are generated for troubleshooting. All tests were run in a local development environment using mock services to simulate email sending.
Screenshots (if appropriate - Postman, etc):
Types of changes
Checklist: