email

package
v0.0.0-...-476b199 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: LGPL-3.0 Imports: 17 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 GetCookedEmail

func GetCookedEmail(email Email) *gomail.Message

func GetEmailMineTxt

func GetEmailMineTxt(email Email) string

func GetExternalTpl

func GetExternalTpl(filename string) string

获取外置模版

func GetInternalEmailTpl

func GetInternalEmailTpl(tplName string) string

获取内建邮件模版

func GetInternalNotifyTpl

func GetInternalNotifyTpl(tplName string) string

获取内建通知模版

func GetInternalTpl

func GetInternalTpl(basePath string, tplName string) string

获取内建模版

func GetPurifiedValue

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

净化文本,防止 XSS

func HandleEmoticonsImgTagsForNotify

func HandleEmoticonsImgTagsForNotify(str string) string

func InitQueue

func InitQueue()

func RenderCommon

func RenderCommon(str string, notify *model.Notify, _renderType ...string) string

func RenderEmailBody

func RenderEmailBody(notify *model.Notify, isSendToAdmin bool) string

渲染邮件 Body 内容

func RenderNotifyBody

func RenderNotifyBody(notify *model.Notify) string

渲染管理员推送 Body 内容

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