Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailConfiguration ¶
EmailConfiguration configures an email sender account.
There is no default email configuration so email credentials are required.
func (EmailConfiguration) Send ¶
func (emailCfg EmailConfiguration) Send(emailMsg EmailMessage) error
Send sends the provided message given an email configuration
type EmailMessage ¶
type EmailMessage struct {
// email sender is not necessarily the same account used in the email configuration, e.g.: no-reply account
From string
To []string
Subject string
Body string
// text/plain or text/html
ContentType string
// Additional headers out of "From", "To", "Subject"
AdditionalHeaders map[string]string
}
EmailMessage harmonises email message format which will be sent by an EmailConfiguration
Jan-2020: Multipart emails are not supported
func NewEmailHTMLMessage ¶
func NewEmailHTMLMessage(from string, to []string, subject string, templatePath string, emailData interface{}) (EmailMessage, error)
NewEmailHTMLMessage generate a HTML EmailMessage from a template path
func NewEmailTextMessage ¶
func NewEmailTextMessage(from string, to []string, subject string, message string) EmailMessage
NewEmailTextMessage generate a basic text EmailMessage
type EmailSender ¶
type EmailSender interface {
Send(emailMsg EmailMessage) error
}
EmailSender qualifies an entity which is capable to send an `EmailMessage`
A given email sender does not have to cover all email format (HTML, text)
Click to show internal directories.
Click to hide internal directories.