import type { Transporter } from "nodemailer";
import nodemailer from "nodemailer";
import type SMTPTransport from "nodemailer/lib/smtp-transport";

export type ConfigOptions = SMTPTransport.Options;

export const MailAdapter = (config: ConfigOptions): Transporter => {
  return nodemailer.createTransport({
    ...config,
  });
};