Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNilMailer = errors.New("no mailer instance")
ErrNilMailer specifies nil mailer instance error
View Source
var ErrNoFrom = errors.New("from option missing")
Functions ¶
func SendMail ¶
SendMail sends mail to given recipients with specified subject and plaintext and HTML message (that's why function requires both). If plaintext of html message is empty, then that format is not used.
func SetupMailer ¶
func SetupMailer(opts ...MailerOption) (err error)
SetupMailer set ups package mailer with specified parameters.
Types ¶
type Mailer ¶
type Mailer struct { Host string Port string Name string From string Creds gosasl.Client Localizer *i18n.Localizer ReturnPath string }
Mailer struct definition.
func NewMailer ¶
func NewMailer(opts ...MailerOption) (*Mailer, error)
NewMailer creates new mailer instance. If we can't create new mailer than error is returned.
type MailerOption ¶
type MailerOption func(*MailerOptions)
func WithCredentials ¶
func WithCredentials(username, password string) MailerOption
func WithFrom ¶
func WithFrom(from string) MailerOption
func WithHost ¶
func WithHost(host string) MailerOption
func WithName ¶
func WithName(name string) MailerOption
func WithPort ¶
func WithPort(port string) MailerOption
func WithReturnPath ¶ added in v1.1.0
func WithReturnPath(returnPath string) MailerOption
Click to show internal directories.
Click to hide internal directories.