email

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderHTMLTemplate

func RenderHTMLTemplate(layout, content string, data map[string]any) (string, error)

func RenderTxtTemplate

func RenderTxtTemplate(content string, data map[string]any) (string, error)

Types

type DumpToTemp

type DumpToTemp struct{}

DumpToTemp transport is for development environment to ensure emails are renderd as HTML ok

once dump operation is done it will try to open the html with default app for html

func (DumpToTemp) Send

func (DumpToTemp) Send(msg *Message) error

type Message

type Message struct {
	ReplyTo *mail.Address `json:"replyTo"`

	ID       string
	From     string `json:"from"`
	Subject  string `json:"subject"`
	HtmlBody string `json:"htmlBody"`
	TxtBody  string `json:"txtBody"`

	To  []mail.Address `json:"to"`
	Cc  []mail.Address `json:"cc"`
	Bcc []mail.Address `json:"bcc"`
}

func (*Message) Validate

func (m *Message) Validate() error

type SMTP

type SMTP struct {
	Host     string
	Port     int
	Username string
	Password string
	// Domain name for smtp
	Domain string
}

SMTP mailer

func (SMTP) Send

func (t SMTP) Send(msg *Message) error

type Transport

type Transport interface {
	Send(*Message) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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