send

package
v5.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DefaultSMTPConfig 默认STMP配置
	DefaultSMTPConfig = &mail.SMTPConfig{}
	// DefaultEmailConfig 默认Email配置
	DefaultEmailConfig = &EmailConfig{}
	// ErrIncorrectRecipient 收信地址不正确
	ErrIncorrectRecipient = errors.New(`The recipient's email address is incorrect`)
)

Functions

func HTMLTmpl

func HTMLTmpl() *template.Template

func InitialHTMLTmpl

func InitialHTMLTmpl()

func InitialMarkdownTmpl

func InitialMarkdownTmpl()

func Mail

func Mail(toEmail string, toUsername string, title string, content []byte, ccList ...string) error

Mail 发送Email @param toEmail 收信邮箱 @param toUsername 收信人名称 @param title 邮件标题 @param content 邮件内容 @param ccList 抄送地址

func MailTpl

func MailTpl() *template.Template

func MailWithID

func MailWithID(id uint64, toEmail string, toUsername string, title string, content []byte, ccList ...string) error

MailWithID 发送Email(带ID参数)

func MailWithIDAndNoticer

func MailWithIDAndNoticer(id uint64, noticer notice.Noticer, toEmail string, toUsername string, title string, content []byte, ccList ...string) error

MailWithIDAndNoticer 发送Email(带ID和Noticer参数)

func MailWithNoticer

func MailWithNoticer(noticer notice.Noticer, toEmail string, toUsername string, title string, content []byte, ccList ...string) error

MailWithNoticer 发送Email(带Noticer参数)

func MarkdownTmpl

func MarkdownTmpl() *template.Template

Types

type Content

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

Content 消息内容结构

func NewContent

func NewContent() *Content

NewContent 创建消息内容结构

func (*Content) EmailContent

func (c *Content) EmailContent(params param.Store) []byte

EmailContent 生成E-mail内容

func (*Content) MarkdownContent

func (c *Content) MarkdownContent(params param.Store) []byte

MarkdownContent 生成Markdown格式内容

type EmailConfig

type EmailConfig struct {
	Template   string
	Sender     string
	Engine     string
	Timeout    int64
	QueueSize  int
	TemplateMd string
}

Jump to

Keyboard shortcuts

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