Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProviderNotSupported = fmt.Errorf("DNS Provider not supported") ErrNoFrom = fmt.Errorf("from not provided") ErrNoRecipients = fmt.Errorf("no recipients provided") ErrNoSubject = fmt.Errorf("no subject provided") ErrNoBody = fmt.Errorf("no body provided") )
Errors
Functions ¶
Types ¶
type Attachment ¶
func NewAttachment ¶
func NewAttachment(name, contentType string, data []byte) *Attachment
func (*Attachment) Validate ¶
func (a *Attachment) Validate() error
type Email ¶
type Email struct { Subject string From *Person To []*Person Cc []*Person Bcc []*Person Body string Attachments []*Attachment }
Define Email struct
type Provider ¶
Define the Provider interface
func GetProvider ¶
func GetProvider(entity ProviderEntity, config ProviderConfig) (Provider, error)
GetProvider returns an email provider
type ProviderConfig ¶
type ProviderConfig map[string]interface{}
func BuildMailgunConfig ¶
func BuildMailgunConfig(domain, apiKey string) ProviderConfig
func BuildSMTPConfig ¶
func BuildSMTPConfig(server string, port int, user, pass string, skipTls bool) ProviderConfig
func BuildSendgridConfig ¶
func BuildSendgridConfig(apiKey string) ProviderConfig
type ProviderEntity ¶
type ProviderEntity string
const ( SMTPProvider ProviderEntity = "SMTP" // TODO: implement breo provider. // BrevoProvider ProviderEntity = "BREVO" MailgunProvider ProviderEntity = "MAILGUN" SendgridProvider ProviderEntity = "SENDGRID" )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.