cmailer

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cmailer provides methods to easily send emails

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfig added in v0.1.3

type AWSConfig struct {
	Region          string `toml:"region"`
	AccessKeyID     string `toml:"access_key_id"`
	SecretAccessKey string `toml:"secret_access_key"`
}

AWSConfig is used to configure the AWS mailer

type Mailer

type Mailer interface {
	Send(ctx context.Context, p SendParams) error
}

Mailer provides methods to send emails.

func NewAWSMailer added in v0.1.3

func NewAWSMailer(appConfig cconfig.Config) (Mailer, error)

NewAWSMailer creates an implementation of Mailer that uses AWS

func NewLogMailer

func NewLogMailer(logger clogger.Logger) Mailer

NewLogMailer creates an implementation of Mailer that logs all sends with the provided logger. Useful during dev as it requires no configuration.

type SendParams

type SendParams struct {
	From    string
	To      []string
	Subject string

	HTMLBody  *string
	PlainBody *string
}

SendParams holds data needed to send an email using Mailer.

Jump to

Keyboard shortcuts

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