It would be nice to have flexibility with how emails are sent. For example, providers like MailChimp, Sendgrid, etc. all use API's to send emails.
Ideally, I could see us changing the signature for email.Send() to, instead of taking an smtp.Auth object, taking anything that implements the Sender interface.
This interface could be simple:
type Sender interface {
Send(e Email) (err error)
}
We could also do this via another method such as SendWithSender() or similar. This way, people could send the email using whatever client they wanted.
We could then provide various clients in a separate package: email/senders that support various APIs.
It would be nice to have flexibility with how emails are sent. For example, providers like MailChimp, Sendgrid, etc. all use API's to send emails.
Ideally, I could see us changing the signature for
email.Send()
to, instead of taking ansmtp.Auth
object, taking anything that implements theSender
interface.This interface could be simple:
We could also do this via another method such as
SendWithSender()
or similar. This way, people could send the email using whatever client they wanted.We could then provide various clients in a separate package:
email/senders
that support various APIs.