This pull request updates the MailService class by introducing Handlebars templates for email content and integrating the AWS SES (Simple Email Service) for sending emails. The sendPasswordResetEmail and sendActivationEmail methods now use the templates for generating email content and utilize the AWS SES service to send the emails.
The new implementation makes it easier to customize and maintain the email templates, and provides a more reliable and scalable email delivery solution. The code has been tested locally and meets the requirements specified in the original implementation.
List of changes:
Added Handlebars and AWS dependencies.
Imported I18nModule and I18nService from nestjs-i18n.
Created resetTemplate and signupTemplate as HandlebarsTemplateDelegate for email content.
Updated constructor to initialize ses as AWS.SES object and resetTemplate and signupTemplate as their respective compiled Handlebars templates.
Updated sendPasswordResetEmail and sendActivationEmail methods to use the Handlebars templates for generating email content.
Added subject and content variables to the email sending methods.
Updated params object to use content variable for email content and subject variable for the email subject.
Updated params object to use a configured sender email address.
Updated try-catch block to log success or error messages when sending the email.
Updated handlebars templates for mail activation and reset password
This pull request updates the MailService class by introducing Handlebars templates for email content and integrating the AWS SES (Simple Email Service) for sending emails. The sendPasswordResetEmail and sendActivationEmail methods now use the templates for generating email content and utilize the AWS SES service to send the emails.
The new implementation makes it easier to customize and maintain the email templates, and provides a more reliable and scalable email delivery solution. The code has been tested locally and meets the requirements specified in the original implementation.
List of changes: