package mailer

import (
	"context"

	"trustcontact/internal/config"
)

type Mailer interface {
	Send(ctx context.Context, to, subject, htmlBody, textBody string) error
}

func NewMailer(cfg *config.Config) (Mailer, error) {
	if cfg.Env == config.EnvDevelop {
		return NewSinkMailer(cfg.EmailSinkDir)
	}

	return NewSMTPMailer(cfg)
}
