mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 17:41:57 +08:00
Feat: cron / Fix: users status check
This commit is contained in:
27
pkg/email/mail.go
Normal file
27
pkg/email/mail.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package email
|
||||
|
||||
import "errors"
|
||||
|
||||
// Driver 邮件发送驱动
|
||||
type Driver interface {
|
||||
// Close 关闭驱动
|
||||
Close()
|
||||
// Send 发送邮件
|
||||
Send(to, title, body string) error
|
||||
}
|
||||
|
||||
var (
|
||||
// ErrChanNotOpen 邮件队列未开启
|
||||
ErrChanNotOpen = errors.New("邮件队列未开启")
|
||||
// ErrNoActiveDriver 无可用邮件发送服务
|
||||
ErrNoActiveDriver = errors.New("无可用邮件发送服务")
|
||||
)
|
||||
|
||||
// Send 发送邮件
|
||||
func Send(to, title, body string) error {
|
||||
if Client == nil {
|
||||
return ErrNoActiveDriver
|
||||
}
|
||||
|
||||
return Client.Send(to, title, body)
|
||||
}
|
||||
Reference in New Issue
Block a user