Documentation
¶
Index ¶
- type Attachment
- type Driver
- type EmailAddress
- type Mailer
- func (m *Mailer) Send() error
- func (m *Mailer) SetAttachments(attachments []Attachment) *Mailer
- func (m *Mailer) SetBCC(emailAddresses []EmailAddress) *Mailer
- func (m *Mailer) SetCC(emailAddresses []EmailAddress) *Mailer
- func (m *Mailer) SetFrom(emailAddress EmailAddress) *Mailer
- func (m *Mailer) SetHTMLBody(body string) *Mailer
- func (m *Mailer) SetPlainTextBody(body string) *Mailer
- func (m *Mailer) SetSubject(subject string) *Mailer
- func (m *Mailer) SetTo(emailAddresses []EmailAddress) *Mailer
- type SMTPConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Driver ¶
type Driver interface {
Send() error
SetFrom(from mail.Address) *smtpDriver
SetTo(toList []mail.Address) *smtpDriver
SetCC(ccList []mail.Address) *smtpDriver
SetBCC(bccList []mail.Address) *smtpDriver
SetSubject(subject string) *smtpDriver
SetHTMLBody(body string) *smtpDriver
SetPlainTextBody(body string) *smtpDriver
SetAttachments(attachments []Attachment) *smtpDriver
}
type EmailAddress ¶
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
func NewMailerWithMailGun ¶
func NewMailerWithMailGun(config *SMTPConfig) *Mailer
Initiate the mailer with MailGun driver
func NewMailerWithSMTP ¶
func NewMailerWithSMTP(config *SMTPConfig) *Mailer
Initiate the mailer with SMTP driver
func NewMailerWithSendGrid ¶
func NewMailerWithSendGrid(config *SMTPConfig) *Mailer
Initiate the mailer with SendGrid driver
func NewMailerWithSparkPost ¶
func NewMailerWithSparkPost(config *SMTPConfig) *Mailer
Initiate the mailer with SparkPost driver
func (*Mailer) SetAttachments ¶
func (m *Mailer) SetAttachments(attachments []Attachment) *Mailer
Add attachments to the email
func (*Mailer) SetBCC ¶
func (m *Mailer) SetBCC(emailAddresses []EmailAddress) *Mailer
List of bcc of the email
func (*Mailer) SetCC ¶
func (m *Mailer) SetCC(emailAddresses []EmailAddress) *Mailer
List of cc of the email
func (*Mailer) SetFrom ¶
func (m *Mailer) SetFrom(emailAddress EmailAddress) *Mailer
Sender of the email
func (*Mailer) SetHTMLBody ¶
Set the body of the email in html format make sure to use only one version of the email body, either the html or the plain text to use the html, call the function SetHTMLBody(body string) and if you want to use the text, call the function SetPlainTextBody(body string)
func (*Mailer) SetPlainTextBody ¶
Set the body of the email in plain text format make sure to use only one version of the email body, either the html or the plain text to use the html, call the function SetHTMLBody(body string) and if you want to use the text, call the function SetPlainTextBody(body string)
func (*Mailer) SetTo ¶
func (m *Mailer) SetTo(emailAddresses []EmailAddress) *Mailer
List of receivers of the email
