const nodemailer = require('nodemailer')

module.exports = class Mailer {
    constructor() {
        this.transporter = nodemailer.createTransport({
            port: 465,
            host: process.env.mail_host,
            auth: {
                user: process.env.mail_email,
                pass: process.env.mail_password,
            },
            secure: true,
        });
    }

    async sendMail(options) {
        return await this.transporter.sendMail(options)
    }
}