Documentation ¶
Index ¶
- Variables
- func ParseEmailAddress(email string) (*mail.Address, error)
- func ParseEmailTemplates(files, subjects map[string]string, defaultLanguage string) (map[string]*template.Template, error)
- func VerifyMXRecord(email string) error
- func WriteError(w http.ResponseWriter, err error)
- type DB
- func (db *DB) EmailRevalidation(ctx context.Context) bool
- func (db *DB) ExecCountContext(ctx context.Context, query string, args ...interface{}) (int64, error)
- func (db *DB) ExecUserContext(ctx context.Context, query string, args ...interface{}) error
- func (db *DB) QueryIterateContext(ctx context.Context, query string, f func(rows *sql.Rows) error, ...) error
- func (db *DB) QueryScanContext(ctx context.Context, query string, results []interface{}, args ...interface{}) error
- func (db *DB) QueryUserContext(ctx context.Context, query string, results []interface{}, args ...interface{}) error
- type EmailConfiguration
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ParseEmailAddress ¶ added in v0.13.0
ParseEmailAddress parses a single RFC 5322 address, e.g. "Barry Gibbs <bg@example.com>"
func ParseEmailTemplates ¶
func VerifyMXRecord ¶ added in v0.13.0
VerifyMXRecord checks if the given email address has a valid MX record. If none is found, it alternatively looks for a valid A or AAAA record as this is used as fallback by mailservers
func WriteError ¶ added in v0.12.3
func WriteError(w http.ResponseWriter, err error)
Types ¶
type DB ¶
func (*DB) EmailRevalidation ¶ added in v0.13.0
EmailRevalidation returns whether email address revalidation is enabled.
func (*DB) ExecCountContext ¶ added in v0.12.3
func (*DB) ExecUserContext ¶ added in v0.12.3
func (*DB) QueryIterateContext ¶ added in v0.12.3
func (*DB) QueryScanContext ¶ added in v0.12.3
type EmailConfiguration ¶
type EmailConfiguration struct { EmailServer string `json:"email_server" mapstructure:"email_server"` EmailHostname string `json:"email_hostname" mapstructure:"email_hostname"` EmailFrom string `json:"email_from" mapstructure:"email_from"` DefaultLanguage string `json:"default_language" mapstructure:"default_language"` EmailAuth smtp.Auth }
func (EmailConfiguration) SendEmail ¶
func (conf EmailConfiguration) SendEmail( templates map[string]*template.Template, subjects map[string]string, templateData map[string]string, to []string, lang string, ) error
SendEmail sends a templated email to the supplied email address(es). When multiple recipients are specified, the email is sent as a BCC email.
func (EmailConfiguration) TranslateString ¶
func (conf EmailConfiguration) TranslateString(strings map[string]string, lang string) string
func (EmailConfiguration) VerifyEmailServer ¶
func (conf EmailConfiguration) VerifyEmailServer() error
Click to show internal directories.
Click to hide internal directories.