Documentation
¶
Index ¶
Constants ¶
View Source
const TempBind = `
您好{{.Username}},您的账号正在尝试修改绑定邮箱。您的验证码为 {{.Code}},有效期15分钟!
`
View Source
const TempForgetPassword = `
您的账号{{.Username}}正在重置密码,验证码为 {{.Code}},有效期15分钟!
`
View Source
const TempRegister = `
您好{{.Username}},欢迎注册我的博客平台。您的验证码为 {{.Code}},有效期15分钟!
`
View Source
const TempSimpleCode = `` /* 4417-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaptchaEmail ¶
验证码邮件内容
type EmailContent ¶
type EmailContent struct { Title string `json:"title"` // 标题 HeadBg string `json:"head_bg"` // 头部背景图 HeadTips string `json:"head_tips"` // 头部提示 DearUser string `json:"dear"` // 亲爱的用户 Content string `json:"content"` // 内容 ButtonTips string `json:"button_tips"` // 按钮提示 ButtonLink string `json:"button_url"` // 按钮链接 ContactUs string `json:"contact_us"` // 联系我们 ContactLink string `json:"contact_link"` // 联系链接 }
func NewEmailContent ¶
func NewEmailContent() *EmailContent
type EmailDeliver ¶
type EmailDeliver struct { Host string // 服务器地址 Port int // 端口 Username string // 发件人 Password string // 密钥 Nickname string // 发件人昵称 Deliver []string // 抄送邮箱:多个以英文逗号分隔 }
func NewEmailDeliver ¶
func NewEmailDeliver(opts ...Option) *EmailDeliver
func (*EmailDeliver) DeliveryEmail ¶
func (s *EmailDeliver) DeliveryEmail(message *EmailMessage) error
type EmailMessage ¶
type IEmailDeliver ¶
type IEmailDeliver interface {
DeliveryEmail(message *EmailMessage) error
}
投递邮件
type MqEmailDeliver ¶
type MqEmailDeliver struct { Deliver *EmailDeliver Publisher mq.MessagePublisher Subscriber mq.MessageSubscriber }
func NewMqEmailDeliver ¶
func NewMqEmailDeliver(deliver *EmailDeliver, pb mq.MessagePublisher, sb mq.MessageSubscriber) *MqEmailDeliver
func (*MqEmailDeliver) DeliveryEmail ¶
func (m *MqEmailDeliver) DeliveryEmail(msg *EmailMessage) error
func (*MqEmailDeliver) SubscribeEmail ¶
func (m *MqEmailDeliver) SubscribeEmail()
type Option ¶
type Option func(*EmailDeliver)
func WithDeliver ¶
func WithNickname ¶
func WithPassword ¶
func WithUsername ¶
Click to show internal directories.
Click to hide internal directories.