mail

package
v0.0.0-...-a11cca7 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Production = false

Production should be set to true in production environment.

Functions

func RenderTemplate

func RenderTemplate(email *Email, context Context) (string, error)

RenderTemplate renders the email into its template with context.

func Send

func Send(email *Email, context Context) error

Send the email using our default adapter and optional context.

Types

type Context

type Context map[string]interface{}

Context defines a simple list of string:value pairs for mail templates.

type Email

type Email struct {
	Recipients []string
	ReplyTo    string
	Subject    string
	Body       string
	Template   string
	Layout     string
}

Email represents an email to be sent.

func New

func New(r string) *Email

New returns a new email with the default tenplates and the given recipient.

func (*Email) Invalid

func (e *Email) Invalid() bool

Invalid returns true if this email is not ready to send.

func (*Email) String

func (e *Email) String() string

String returns a formatted string representation for debug.

type Sender

type Sender interface {
	Send(email *Email) error
}

Sender is the interface for our adapters for mail services.

var Service Sender

Service is the mail adapter to send with and should be set on startup.

Directories

Path Synopsis
adapters

Jump to

Keyboard shortcuts

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