Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
Attachment represents an email attachment
type Email ¶
type Email struct {
To, Cc, Bcc []string
ToNames, CcNames, BccNames []string
FromName, From string
ReplyToName, ReplyTo string
Subject string
Attachments []Attachment
TextBody string
HTMLBody string
}
Email all the things. The ToNames and friends are parallel arrays and must be 0-length or the same length as their counterpart. To omit a name for a user at an index in To simply use an empty string at that index in ToNames.
type Mailer ¶
type Mailer interface {
Send(ctx context.Context, email Email) (provider, msdID string, err error)
}
Mailer sends emails
type MultiMailer ¶
type MultiMailer struct {
// contains filtered or unexported fields
}
MultiMailer takes multiple mailers and sends with them in sucession This is to be used for failovers
func NewMultiMailer ¶
func NewMultiMailer(mailers ...Mailer) (*MultiMailer, error)
NewMultiMailer creates a new instance of a MultiMailer from a bunch of other mailers
func (MultiMailer) Send ¶
Send satisfies the Mailer interface. If an error is returned from this, it means ALL the mailers failed and the error will be a combination of all the errors received from every component mailer However, if any Mailer is successful, it will supress the errors from the previous ones