package mailimp

import (
	mb "github.com/tech/sendico/notification/internal/server/notificationimp/mail/internal/builder"
	b "github.com/tech/sendico/notification/internal/server/notificationimp/mail/messagebuilder"
	"github.com/tech/sendico/pkg/merrors"
	"github.com/tech/sendico/pkg/mlogger"
)

type Dummy struct {
	logger mlogger.Logger
}

func (d *Dummy) Send(_ b.MailBuilder) error {
	d.logger.Warn("Unexpected request to send email")
	return merrors.NotImplemented("MailDummy::Send")
}

func (d *Dummy) MailBuilder() b.MailBuilder {
	return mb.NewMessageBuilder()
}

func NewDummy(logger mlogger.Logger) (*Dummy, error) {
	d := &Dummy{
		logger: logger.Named("dummy"),
	}
	d.logger.Info("Mailer installed")
	return d, nil
}
