✉️ Email SMTP Auth and Logs (#278)

Co-authored-by: Monta <monta@HP-ProBook-445-14-inch-G9-Notebook-PC-505aadfc.localdomain>
This commit is contained in:
Montassar Ghanmy
2023-11-23 15:03:53 +01:00
committed by GitHub
parent c372afd390
commit 255cf07b07
2 changed files with 10 additions and 4 deletions
@@ -43,8 +43,7 @@ export default class EmailPusherClass
const smtpConfig: SMTPClientConfigType = {
host: this.configuration.get<string>("smtp_host", ""),
port: this.configuration.get<number>("smtp_port", 25),
requireTLS: this.configuration.get<boolean>("smtp_tls", false),
secure: this.configuration.get<boolean>("smtp_tls", false),
secure: false,
};
this.transporter = nodemailer.createTransport(smtpConfig);
this.sender = this.configuration.get<string>("smtp_from", "");
@@ -145,7 +144,14 @@ export default class EmailPusherClass
this.logger.info("Message sent: %s", info.response);
} catch (err) {
this.logger.error(
{ error: `${err}`, secure: this.configuration.get<boolean>("smtp_tls", false) },
{
error: `${err}`,
smtpConfig: {
host: this.configuration.get<string>("smtp_host", ""),
port: this.configuration.get<number>("smtp_port", 25),
secure: false,
},
},
"Failed to send email",
);
}
@@ -50,7 +50,7 @@ export type SMTPClientConfigType = {
host: string;
port: number;
secure?: boolean;
requireTLS: boolean;
requireTLS?: boolean;
auth?: {
user: string;
pass: string;