mailer

package
v0.0.0-...-e282ec7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Sender *gomail.Dialer
)

Functions

func InitMailTemplate

func InitMailTemplate(bodyTpl *template.Template)

func NewContext

func NewContext()

func SendActiveCodeMail

func SendActiveCodeMail(email string, code string)

func SendAsync

func SendAsync(msg *Message)

func SendResetPwdCodeMail

func SendResetPwdCodeMail(email string, code string)

func SendUserMail

func SendUserMail(u *models.User, tpl string, code, subject string)

Types

type Message

type Message struct {
	Subject     string
	FromAddress string
	FromName    string
	To          []string
	Date        time.Time
	Body        string
	Headers     map[string][]string
}

func NewMessage

func NewMessage(to []string, subject, body string) *Message

func NewMessageFrom

func NewMessageFrom(to []string, fromName, fromAddress, subject, body string) *Message

func (*Message) SetHeader

func (m *Message) SetHeader(field string, value ...string)

func (*Message) ToMessage

func (m *Message) ToMessage() *gomail.Message

Jump to

Keyboard shortcuts

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