Documentation
¶
Overview ¶
Package mailtemplate holds built-in mail template metadata (codes expected by send logic).
Index ¶
Constants ¶
View Source
const ( TplEmailLoginCode = "html/email_login_code.html" TplEmailVerification = "html/email_verification.html" TplVerification = "html/verification.html" TplPasswordReset = "html/password_reset.html" TplWelcome = "html/welcome.html" TplNewDeviceLogin = "html/new_device_login.html" TplDeviceVerification = "html/device_verification.html" TplGroupInvitation = "html/group_invitation.html" )
嵌入模版路径(相对本包 embed 根)。
Variables ¶
This section is empty.
Functions ¶
func RenderHTML ¶
RenderHTML 读取嵌入文件并用 html/template 渲染(自动转义文本字段)。
func UsernameFromEmail ¶
UsernameFromEmail 用邮箱 @ 前作为称呼占位。
Types ¶
type Preset ¶
type Preset struct {
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
HTMLBody string `json:"htmlBody"`
Variables string `json:"variables"` // JSON array string
}
Preset is a suggested row for admin UI; business code loads templates by Code from DB.
func DefaultPresets ¶
func DefaultPresets() []Preset
DefaultPresets returns known template codes and default HTML skeletons (plain text is derived from HTML on save).
Click to show internal directories.
Click to hide internal directories.