Documentation
¶
Index ¶
- type ChangeEmailTemplateData
- type EmailConfig
- type EmailRepo
- type EmailService
- func (es *EmailService) ChangeEmailTemplate(ctx context.Context, changeEmailUrl string) (title, body string, err error)
- func (es *EmailService) GetEmailConfig() (ec *EmailConfig, err error)
- func (es *EmailService) GetSiteGeneral(ctx context.Context) (resp schema.SiteGeneralResp, err error)
- func (es *EmailService) PassResetTemplate(ctx context.Context, passResetUrl string) (title, body string, err error)
- func (es *EmailService) RegisterTemplate(ctx context.Context, registerUrl string) (title, body string, err error)
- func (es *EmailService) Send(ctx context.Context, toEmailAddr, subject, body, code, codeContent string)
- func (es *EmailService) SetEmailConfig(ec *EmailConfig) (err error)
- func (es *EmailService) TestTemplate(ctx context.Context) (title, body string, err error)
- func (es *EmailService) VerifyUrlExpired(ctx context.Context, code string) (content string)
- type PassResetTemplateData
- type RegisterTemplateData
- type TestTemplateData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeEmailTemplateData ¶
type EmailConfig ¶
type EmailConfig struct {
FromEmail string `json:"from_email"`
FromName string `json:"from_name"`
SMTPHost string `json:"smtp_host"`
SMTPPort int `json:"smtp_port"`
Encryption string `json:"encryption"` // "" SSL
SMTPUsername string `json:"smtp_username"`
SMTPPassword string `json:"smtp_password"`
SMTPAuthentication bool `json:"smtp_authentication"`
RegisterTitle string `json:"register_title"`
RegisterBody string `json:"register_body"`
PassResetTitle string `json:"pass_reset_title"`
PassResetBody string `json:"pass_reset_body"`
ChangeTitle string `json:"change_title"`
ChangeBody string `json:"change_body"`
TestTitle string `json:"test_title"`
TestBody string `json:"test_body"`
}
EmailConfig email config
func (*EmailConfig) IsSSL ¶
func (e *EmailConfig) IsSSL() bool
type EmailRepo ¶
type EmailRepo interface {
SetCode(ctx context.Context, code, content string) error
VerifyCode(ctx context.Context, code string) (content string, err error)
}
EmailRepo email repository
type EmailService ¶
type EmailService struct {
// contains filtered or unexported fields
}
EmailService kit service
func NewEmailService ¶
func NewEmailService(configRepo config.ConfigRepo, emailRepo EmailRepo, siteInfoRepo siteinfo_common.SiteInfoRepo) *EmailService
NewEmailService email service
func (*EmailService) ChangeEmailTemplate ¶
func (*EmailService) GetEmailConfig ¶
func (es *EmailService) GetEmailConfig() (ec *EmailConfig, err error)
func (*EmailService) GetSiteGeneral ¶
func (es *EmailService) GetSiteGeneral(ctx context.Context) (resp schema.SiteGeneralResp, err error)
func (*EmailService) PassResetTemplate ¶
func (*EmailService) RegisterTemplate ¶
func (*EmailService) Send ¶
func (es *EmailService) Send(ctx context.Context, toEmailAddr, subject, body, code, codeContent string)
Send email send
func (*EmailService) SetEmailConfig ¶
func (es *EmailService) SetEmailConfig(ec *EmailConfig) (err error)
SetEmailConfig set email config
func (*EmailService) TestTemplate ¶
func (es *EmailService) TestTemplate(ctx context.Context) (title, body string, err error)
func (*EmailService) VerifyUrlExpired ¶
func (es *EmailService) VerifyUrlExpired(ctx context.Context, code string) (content string)
VerifyUrlExpired email send
type PassResetTemplateData ¶
type RegisterTemplateData ¶
type TestTemplateData ¶
type TestTemplateData struct {
SiteName string
}
Click to show internal directories.
Click to hide internal directories.