mail

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderHTML

func RenderHTML(tmpl string, data interface{}) (string, error)

RenderHTML renders an HTML email body from template

func RenderText

func RenderText(tmpl string, data interface{}) (string, error)

RenderText renders a plain text email body from template

Types

type Attachment

type Attachment struct {
	Filename    string
	ContentType string
	Data        []byte
}

type Mailer

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

func New

func New(provider Provider, fromName, fromAddr string) *Mailer

func (*Mailer) Send

func (m *Mailer) Send(ctx context.Context, to string, subject string, text string, html string) error

type Message

type Message struct {
	To          []string
	Cc          []string
	Bcc         []string
	Subject     string
	TextBody    string
	HTMLBody    string
	Attachments []Attachment
}

type Provider

type Provider interface {
	Send(ctx context.Context, msg *Message) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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