mailer

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

type Mailer struct {
	// contains filtered or unexported fields
}

Mailer contains a mail.Dialer instance (used to connect to an SMTP server) and the sender information for our emails (the name and address we want the email to be from, such as "Alice Smith <alice@example.com>").

func New

func New(host string, port int, username, password, sender string) Mailer

New initializes a new mail.Dialer instance with the given SMTP server settings and a 5-second timeout whenever we send an email. It returns a Mailer instance containing the dialer and sender information.

func (Mailer) Send

func (m Mailer) Send(recipient, templateFile string, data interface{}) error

Send takes a recipient email address, name of a template file, and any dynamic data and sends the executed template as an email.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL