mailgun

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailgun

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

Mailgun struct holds necessary data to communicate with the Mailgun API.

func New

func New(domain, apiKey, senderAddress string, opts ...Option) *Mailgun

New returns a new instance of a Mailgun notification service. You will need a Mailgun API key and domain name. See https://documentation.mailgun.com/en/latest/

func (*Mailgun) AddReceivers

func (m *Mailgun) AddReceivers(addresses ...string)

AddReceivers takes email addresses and adds them to the internal address list. The Send method will send a given message to all those addresses.

func (Mailgun) Send

func (m Mailgun) Send(ctx context.Context, subject, message string) error

Send takes a message subject and a message body and sends them to all previously set chats. Message body supports html as markup language.

type Option

type Option func(*Mailgun)

Option describes a functional parameter for the Mailgun constructor.

func WithEurope

func WithEurope() Option

WithEurope sets the API Mailgun base url to Europe region.

Jump to

Keyboard shortcuts

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