✉️ 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 = {
|
const smtpConfig: SMTPClientConfigType = {
|
||||||
host: this.configuration.get<string>("smtp_host", ""),
|
host: this.configuration.get<string>("smtp_host", ""),
|
||||||
port: this.configuration.get<number>("smtp_port", 25),
|
port: this.configuration.get<number>("smtp_port", 25),
|
||||||
requireTLS: this.configuration.get<boolean>("smtp_tls", false),
|
secure: false,
|
||||||
secure: this.configuration.get<boolean>("smtp_tls", false),
|
|
||||||
};
|
};
|
||||||
this.transporter = nodemailer.createTransport(smtpConfig);
|
this.transporter = nodemailer.createTransport(smtpConfig);
|
||||||
this.sender = this.configuration.get<string>("smtp_from", "");
|
this.sender = this.configuration.get<string>("smtp_from", "");
|
||||||
@@ -145,7 +144,14 @@ export default class EmailPusherClass
|
|||||||
this.logger.info("Message sent: %s", info.response);
|
this.logger.info("Message sent: %s", info.response);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.logger.error(
|
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",
|
"Failed to send email",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export type SMTPClientConfigType = {
|
|||||||
host: string;
|
host: string;
|
||||||
port: number;
|
port: number;
|
||||||
secure?: boolean;
|
secure?: boolean;
|
||||||
requireTLS: boolean;
|
requireTLS?: boolean;
|
||||||
auth?: {
|
auth?: {
|
||||||
user: string;
|
user: string;
|
||||||
pass: string;
|
pass: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user