Commit 56572e3f authored by Fabien Forestier's avatar Fabien Forestier
Browse files

Merge branch 'development' into 'master'

Version 1.2.2

See merge request refonte-data/service-email!4
parents b62b9c04 6538023d
Pipeline #2443 passed with stage
in 7 seconds
{
"name": "service-email",
"version": "1.2.1",
"version": "1.2.2",
"description": "description",
"author": "",
"license": "MIT",
......
......@@ -106,14 +106,14 @@ export class EmailService {
const transporter = Nodemailer.createTransport(this.config.smtpConfig);
await transporter.verify().catch((error) => {
this.logger.error('SMTP connection failed.', error, `${EmailService.name} - ${this.send.name}`);
this.logger.error('SMTP connection failed.', `${error}`, `${EmailService.name} - ${this.send.name}`);
throw new InternalServerErrorException({ error, message: 'SMTP connection failed.' });
});
this.logger.log('SMTP Server is ready to receive messages', `${EmailService.name} - ${this.send.name}`);
await transporter.sendMail(email).catch((error) => {
this.logger.error('Couldn\'t send email.', error, `${EmailService.name} - ${this.send.name}`);
this.logger.error('Couldn\'t send email.', `${error}`, `${EmailService.name} - ${this.send.name}`);
transporter.close();
throw new InternalServerErrorException({ error, message: 'Couldn\'t send email.' });
});
......
......@@ -22,7 +22,7 @@ export class SmtpHealthIndicator extends HealthIndicator {
const transporter = Nodemailer.createTransport(this.configService.config.smtpConfig);
await transporter.verify().catch((error) => {
this.logger.error('SMTP connection failed.', error, `${SmtpHealthIndicator.name} - ${this.checkSMTPConnection.name}`);
this.logger.error('SMTP connection failed.', `${error}`, `${SmtpHealthIndicator.name} - ${this.checkSMTPConnection.name}`);
transporter.close();
throw new HealthCheckError('SMTP connection failed', error);
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment