email

package
v0.0.0-...-63f7a73 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToQueue

func AddToQueue(email Email)

func AsyncSend

func AsyncSend(notify *model.Notify)

func AsyncSendTo

func AsyncSendTo(subject string, body string, toAddr string)

func AsyncSendToAdmin

func AsyncSendToAdmin(notify *model.Notify, admin *model.User)

func GetCookedEmail

func GetCookedEmail(email Email) *gomail.Message

func GetEmailMineTxt

func GetEmailMineTxt(email Email) string

func GetExternalEmailTpl

func GetExternalEmailTpl(filename string) string

获取外置模版

func GetInternalEmailTpl

func GetInternalEmailTpl(tplName string) string

获取内建模版

func GetPurifiedValue

func GetPurifiedValue(k string, v interface{}) string

净化文本,防止 XSS

func InitQueue

func InitQueue()

func ReplaceAllMustache

func ReplaceAllMustache(data string, dict map[string]interface{}) string

替换 {{ key }} 为 val

func SendByAliDM

func SendByAliDM(email Email) bool

func SendBySMTP

func SendBySMTP(email Email) bool

func SendByUsingSystemCMD

func SendByUsingSystemCMD(email Email) bool

Types

type CommonFields

type CommonFields struct {
	From          model.CookedCommentForEmail `json:"from"`
	To            model.CookedCommentForEmail `json:"to"`
	Comment       model.CookedCommentForEmail `json:"comment"`
	ParentComment model.CookedCommentForEmail `json:"parent_comment"`

	Nick         string `json:"nick"`
	Content      string `json:"content"`
	ReplyNick    string `json:"reply_nick"`
	ReplyContent string `json:"reply_content"`

	PageTitle string `json:"page_title"`
	PageURL   string `json:"page_url"`
	SiteName  string `json:"site_name"`
	SiteURL   string `json:"site_url"`

	LinkToReply string `json:"link_to_reply"`
}

type Email

type Email struct {
	FromAddr     string
	FromName     string
	ToAddr       string
	Subject      string
	Body         string
	LinkedNotify *model.Notify
}

Jump to

Keyboard shortcuts

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