jmail

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrorCode

func IsErrorCode(err error, code ErrorCode) bool

func Module

func Module() jelly.Module

func RenderHTMLTemplate

func RenderHTMLTemplate(tmpl *htmltmpl.Template, data any) (string, error)

func RenderTextTemplate

func RenderTextTemplate(tmpl *texttmpl.Template, data any) (string, error)

func Send

func Send(ctx context.Context, message Message) error

Types

type Address

type Address struct {
	Email string `yaml:"email"`
	Name  string `yaml:"name"`
}

type Error

type Error struct {
	Code ErrorCode
	Op   string
	Err  error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorCode

type ErrorCode string
const (
	ErrCodeNotConfigured     ErrorCode = "not_configured"
	ErrCodeInvalidConfig     ErrorCode = "invalid_config"
	ErrCodeInvalidMessage    ErrorCode = "invalid_message"
	ErrCodeInvalidAddress    ErrorCode = "invalid_address"
	ErrCodeConnection        ErrorCode = "connection_failed"
	ErrCodeTimeout           ErrorCode = "timeout"
	ErrCodeAuth              ErrorCode = "auth_failed"
	ErrCodeRecipientRejected ErrorCode = "recipient_rejected"
	ErrCodeDeliveryFailed    ErrorCode = "delivery_failed"
	ErrCodeTransport         ErrorCode = "transport_error"
)

type Message

type Message struct {
	From    *Address
	To      []Address
	CC      []Address
	BCC     []Address
	ReplyTo []Address
	Subject string
	Text    string
	HTML    string
}

Jump to

Keyboard shortcuts

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