mailgun

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PasswordReset is an event that happens when the user's password is reset.
	PasswordReset providers.Event = "Password Reset"
	// GenerateConfirmCode is an event before password reset which sends a confirm code to the user's email address.
	GenerateConfirmCode providers.Event = "Confirm Code"
	// Welcome template for new sign-ups.
	Welcome providers.Event = "Welcome"
)

Functions

This section is empty.

Types

type BufferNotifier

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

BufferNotifier uses a byte buffer for notifications.

func NewBufferNotifier

func NewBufferNotifier() *BufferNotifier

NewBufferNotifier creates a new notifier.

func (*BufferNotifier) Notify

func (b *BufferNotifier) Notify(email string, event providers.Event, payload providers.Payload) error

Notify uses a buffer to store notifications for a user.

type Config

type Config struct {
	Domain string
	APIKey string
}

Config is configuration for this provider.

type Dependencies

type Dependencies struct {
	Logger zerolog.Logger
	Clock  providers.Clock
}

Dependencies contains dependencies this provider uses.

type Sender

type Sender struct {
	Config
	Dependencies
}

Sender is an email sender using Mailgun as a backend.

func NewMailgunSender

func NewMailgunSender(cfg Config, deps Dependencies) (*Sender, error)

NewMailgunSender will connect to mailgun and return a mailgun email sender.

func (*Sender) Notify

func (e *Sender) Notify(email string, event providers.Event, payload providers.Payload) error

Notify attempts to send out an email using mailgun contaning the new password. Does not need to be a pointer receiver because it isn't storing anything.

Jump to

Keyboard shortcuts

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