This commit is contained in:
+11
-4
@@ -2,7 +2,6 @@ package email
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/ssdomei232/goodBaby/model"
|
||||
)
|
||||
@@ -14,8 +13,16 @@ func (e *EmailExecutor) GetType() string {
|
||||
return RuleType
|
||||
}
|
||||
|
||||
func (e *EmailExecutor) Execute(ctx context.Context, rule *model.Rule) error {
|
||||
log.Printf("执行邮件规则: %s (ID: %d)", rule.Name, rule.ID)
|
||||
func (e *EmailExecutor) Execute(ctx context.Context, task *model.RuleTask) error {
|
||||
account, err := ParseAccountConfig(task.AccountConfig())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return SendMail(ctx, rule)
|
||||
config, err := ParseRuleConfig(task.Rule.ConfigJson)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return SendMail(ctx, account, config)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user