email icon indicating copy to clipboard operation
email copied to clipboard

Consider the Use of a Sender Interface

Open jordan-wright opened this issue 10 years ago • 1 comments

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.

jordan-wright avatar Oct 21 '15 02:10 jordan-wright

Going to make this a higher priority now that https://github.com/gophish/gophish/issues/77 depends on this being possible.

jordan-wright avatar Jan 21 '16 05:01 jordan-wright