2026-06-19 18:47:36 +08:00
|
|
|
package email
|
2026-06-06 19:31:16 +08:00
|
|
|
|
|
|
|
|
import (
|
2026-07-26 22:19:41 +08:00
|
|
|
"context"
|
2026-06-06 19:31:16 +08:00
|
|
|
"log"
|
|
|
|
|
|
|
|
|
|
"github.com/ssdomei232/goodBaby/model"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// EmailExecutor 邮件执行器
|
|
|
|
|
type EmailExecutor struct{}
|
|
|
|
|
|
|
|
|
|
func (e *EmailExecutor) GetType() string {
|
2026-07-26 22:19:41 +08:00
|
|
|
return RuleType
|
2026-06-06 19:31:16 +08:00
|
|
|
}
|
|
|
|
|
|
2026-07-26 22:19:41 +08:00
|
|
|
func (e *EmailExecutor) Execute(ctx context.Context, rule *model.Rule) error {
|
2026-06-06 19:31:16 +08:00
|
|
|
log.Printf("执行邮件规则: %s (ID: %d)", rule.Name, rule.ID)
|
|
|
|
|
|
2026-07-26 22:19:41 +08:00
|
|
|
return SendMail(ctx, rule)
|
2026-06-06 19:31:16 +08:00
|
|
|
}
|