drivers

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 14 Imported by: 14

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMailgun

func NewMailgun(cfg mail.Config) (mail.Mailer, error)

NewMailgun creates a new Mailgun client. Configuration is validated before initialisation.

Example
cfg := mail.Config{
	URL:         "https://api.eu.mailgun.net", // Or https://api.mailgun.net
	APIKey:      "my-key",
	FromAddress: "hello@gophers.com",
	FromName:    "Gopher",
	Domain:      "my-domain.com",
}

_, err := NewMailgun(cfg)
if err != nil {
	log.Fatalln(err)
}
Output:

func NewPostal

func NewPostal(cfg mail.Config) (mail.Mailer, error)

NewPostal creates a new Postal client. Configuration is validated before initialisation.

Example
cfg := mail.Config{
	URL:         "https://postal.example.com",
	APIKey:      "my-key",
	FromAddress: "hello@gophers.com",
	FromName:    "Gopher",
}

_, err := NewPostal(cfg)
if err != nil {
	log.Fatalln(err)
}
Output:

func NewPostmark

func NewPostmark(cfg mail.Config) (mail.Mailer, error)

NewPostmark creates a new Postmark client. Configuration is validated before initialisation.

Example
cfg := mail.Config{
	URL:         "https://postal.example.com",
	APIKey:      "my-key",
	FromAddress: "hello@gophers.com",
	FromName:    "Gopher",
}

_, err := NewPostal(cfg)
if err != nil {
	log.Fatalln(err)
}
Output:

func NewSMTP

func NewSMTP(cfg mail.Config) (mail.Mailer, error)

NewSMTP creates a new smtp client. Configuration is validated before initialisation.

func NewSendGrid

func NewSendGrid(cfg mail.Config) (mail.Mailer, error)

NewSendGrid creates a new sendGrid client. Configuration is validated before initialisation.

Example
cfg := mail.Config{
	APIKey:      "my-key",
	FromAddress: "hello@gophers.com",
	FromName:    "Gopher",
}

_, err := NewSendGrid(cfg)
if err != nil {
	log.Fatalln(err)
}
Output:

func NewSparkPost

func NewSparkPost(cfg mail.Config) (mail.Mailer, error)

NewSparkPost creates a new SparkPost client. Configuration is validated before initialisation.

Example
cfg := mail.Config{
	URL:         "https://api.eu.sparkpost.com", // Or https://api.sparkpost.com/api/v1
	APIKey:      "my-key",
	FromAddress: "hello@gophers.com",
	FromName:    "Gopher",
}

_, err := NewSparkPost(cfg)
if err != nil {
	log.Fatalln(err)
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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