✉️ 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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user