mailer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const EMAIL_FS_PREFIX = "templates/"
View Source
const TPL_PASSWORD_RESET = "password_reset"
View Source
const TPL_VERIFY_EMAIL = "verify_email"

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 {
	Subject *template.Template
	Body    *template.Template
}

type TemplateRegistry

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

func NewTemplateRegistry

func NewTemplateRegistry() *TemplateRegistry

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