Documentation
¶
Overview ¶
Package email provides an interface for plugins and application code to send email. [Gomail](gopkg.in/gomail.v2) is used with SMTP as the default.
SMTP can be configured using global configuration, either as ENV or from a configuration file.
|---------------------|---------------------| | Env | JSON | | --------------------|---------------------| | EMAIL_FROM | email.from | | EMAIL_SMTP_HOST | email.smtp.host | | EMAIL_SMTP_PORT | email.smtp.port | | EMAIL_SMTP_USERNAME | email.smtp.username | | EMAIL_SMTP_PASSWORD | email.smtp.password | |---------------------|---------------------|
Index ¶
Constants ¶
const PluginName = "email"
Constant name for identifying the email plugin.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailOption ¶
type EmailOption func(*EmailPlugin)
EmailOptions customize the configuration of the email plugin.
func WithFrom ¶
func WithFrom(from string) EmailOption
WithFrom configures the default from address.
type EmailPlugin ¶
type EmailPlugin struct {
// contains filtered or unexported fields
}
EmailPlugin exposes the ability to send emails.
func (*EmailPlugin) Send ¶
Send an email. TODO: Switch to daemon mode per example here: https://pkg.go.dev/gopkg.in/gomail.v2#example-package-Daemon