mailer

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const EMAIL_FS_PREFIX = "templates/"

Variables

View Source
var ErrTemplateNotFound = errors.New("template not found")

Functions

This section is empty.

Types

type Email

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

func NewEmail

func NewEmail(subject, body string) *Email

func (*Email) Body

func (e *Email) Body() string

func (*Email) From

func (e *Email) From() string

func (*Email) SetBody

func (e *Email) SetBody(body string)

func (*Email) SetFrom

func (e *Email) SetFrom(from string)

func (*Email) SetSubject

func (e *Email) SetSubject(subject string)

func (*Email) SetTo

func (e *Email) SetTo(to string)

func (*Email) Subject

func (e *Email) Subject() string

func (*Email) To

func (e *Email) To() string

func (*Email) ToMessage

func (e *Email) ToMessage() (*mail.Msg, error)

type EmailTemplate

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

func NewMailerTemplate added in v0.2.0

func NewMailerTemplate(subject *template.Template, body *template.Template) *EmailTemplate

func (*EmailTemplate) Body

func (et *EmailTemplate) Body() *template.Template

func (*EmailTemplate) Subject

func (et *EmailTemplate) Subject() *template.Template

type TemplateRegistry

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

func NewTemplateRegistry

func NewTemplateRegistry() *TemplateRegistry

func (*TemplateRegistry) RegisterTemplate added in v0.2.0

func (tr *TemplateRegistry) RegisterTemplate(name string, template core.MailerTemplate)

func (*TemplateRegistry) RenderTemplate

func (tr *TemplateRegistry) RenderTemplate(templateName string, subjectVars core.MailerTemplateData, bodyVars core.MailerTemplateData) (*Email, error)

Jump to

Keyboard shortcuts

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