constructor() { this.moduleLogger = logger.child({ module: 'mail' }); this.transportConfig = { host: process.env.SMTP_HOST, port: process.env.SMTP_PORT, secure: process.env.SMTP_SECURE === 'true' }; if (process.env.SMTP_SECURE === 'true') { this.transportConfig.auth.user = process.env.SMTP_AUTH_USER; this.transportConfig.auth.pass = process.env.SMTP_AUTH_PASS; } if (process.env.SMTP_DEBUG === 'true') { this.transportConfig.debug = true; } if (process.env.SMTP_LOGGER === 'true') { this.transportConfig.logger = true; } this.transporter = nodemailer.createTransport(this.transportConfig); this.moduleLogger.debug({ transportConfig: this.transportConfig }, 'mail class initialized'); }