Documentation
¶
Index ¶
- Variables
- func Init(cfg Config)
- func NewActivationEmail(username, activateURL string) (subject string, body string)
- func NewActivationHTMLEmail(username, activateURL string) (subject string, body string)
- func NewResetPasswordEmail(username, resetURL string) (subject string, body string)
- func NewResetPasswordHTMLEmail(username, resetURL string) (subject string, body string)
- func Send(to, subject, body string) error
- type ActiveUserMailData
- type Config
- type Driver
- type ResetPasswordMailData
- type SMTP
- type SMTPConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrChanNotOpen 邮件队列没有开启 ErrChanNotOpen = errors.New("email queue does not open") )
View Source
var Lock sync.RWMutex
Lock 读写锁
Functions ¶
func NewActivationEmail ¶
NewActivationEmail 发送激活邮件
func NewActivationHTMLEmail ¶
NewActivationHTMLEmail 发送激活邮件 html
func NewResetPasswordEmail ¶
NewResetPasswordEmail 发送重置密码邮件
func NewResetPasswordHTMLEmail ¶
NewResetPasswordHTMLEmail 发送重置密码邮件 html
Types ¶
type ActiveUserMailData ¶
type ActiveUserMailData struct {
HomeURL string `json:"home_url"`
WebsiteName string `json:"website_name"`
WebsiteDomain string `json:"website_domain"`
ActivateURL string `json:"activate_url"`
Year int `json:"year"`
}
ActiveUserMailData 激活用户模板数据
type Config ¶
type Config struct {
Host string
Port int
Username string
Password string
Name string
Address string
ReplyTo string
KeepAlive int
}
Config email config
type ResetPasswordMailData ¶
type ResetPasswordMailData struct {
HomeURL string `json:"home_url"`
WebsiteName string `json:"website_name"`
WebsiteDomain string `json:"website_domain"`
ResetURL string `json:"reset_url"`
Year int `json:"year"`
}
ResetPasswordMailData 激活用户模板数据
type SMTP ¶
type SMTP struct {
Config SMTPConfig
// contains filtered or unexported fields
}
SMTP 协议协议发送
Click to show internal directories.
Click to hide internal directories.