🪵 Added logs to check if secure is enable (#276)

This commit is contained in:
Montassar Ghanmy
2023-11-23 14:33:16 +01:00
committed by GitHub
parent fe6c0a7ed7
commit c372afd390
2 changed files with 5 additions and 6 deletions
@@ -45,10 +45,6 @@ export default class EmailPusherClass
port: this.configuration.get<number>("smtp_port", 25),
requireTLS: this.configuration.get<boolean>("smtp_tls", false),
secure: this.configuration.get<boolean>("smtp_tls", false),
auth: {
user: this.configuration.get<string>("smtp_user", ""),
pass: this.configuration.get<string>("smtp_password", ""),
},
};
this.transporter = nodemailer.createTransport(smtpConfig);
this.sender = this.configuration.get<string>("smtp_from", "");
@@ -148,7 +144,10 @@ export default class EmailPusherClass
this.logger.info("Message sent: %s", info.response);
} catch (err) {
this.logger.error({ error: `${err}` }, "Failed to send email");
this.logger.error(
{ error: `${err}`, secure: this.configuration.get<boolean>("smtp_tls", false) },
"Failed to send email",
);
}
} else {
this.logger.info("sending email via api interface.");
@@ -51,7 +51,7 @@ export type SMTPClientConfigType = {
port: number;
secure?: boolean;
requireTLS: boolean;
auth: {
auth?: {
user: string;
pass: string;
};