mailer

package
v0.0.0-...-6fd8457 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mailer provides a simple mailer for sending emails.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderWelcome

func RenderWelcome() (string, error)

Types

type Mailer

type Mailer struct {
	Host     string `json:"host,omitempty"`
	Port     int    `json:"port,omitempty"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	From     string `json:"from,omitempty"`
}

func (*Mailer) Ready

func (m *Mailer) Ready() bool

func (*Mailer) Send

func (m *Mailer) Send(msg *Message) error

type Message

type Message struct {
	Subject string
	To      mail.Address
	From    mail.Address
	Body    string
}

type MessageBuilder

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

func NewMessageBuilder

func NewMessageBuilder() *MessageBuilder

func (*MessageBuilder) Build

func (mb *MessageBuilder) Build() *Message

func (*MessageBuilder) SetBody

func (mb *MessageBuilder) SetBody(body string) *MessageBuilder

func (*MessageBuilder) SetFrom

func (mb *MessageBuilder) SetFrom(name, from string) *MessageBuilder

func (*MessageBuilder) SetSubject

func (mb *MessageBuilder) SetSubject(subject string) *MessageBuilder

func (*MessageBuilder) SetTo

func (mb *MessageBuilder) SetTo(name, to string) *MessageBuilder

type TemplateDefaults

type TemplateDefaults struct {
	CompanyName        string
	CompanyAddress     string
	CompanyURL         string
	ActivateAccountURL string
	UnsubscribeURL     string
}

type TemplateProps

type TemplateProps struct {
	Defaults TemplateDefaults
	Data     map[string]string
}

func DefaultTemplateData

func DefaultTemplateData() TemplateProps

func (*TemplateProps) Set

func (tp *TemplateProps) Set(key, value string)

Jump to

Keyboard shortcuts

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