const { transporter } = require("../utils/transporter");

class EmailService {
  /**
   * Send notification email
   * @param {string} to
   * @param {string} subject
   * @param {string} body
   */
  static async sendMail(others) {
    try {
      await transporter.sendMail({
        ...others
      });
      return true;
    } catch (error) {
      console.error('Email sending failed:', error);
      throw error;
    }
  }
}

module.exports = EmailService;