|
|
@@ -27,11 +27,13 @@ func SendTemplateMsg(template Template, ctx *TemplateContext, userId int64) erro |
|
|
|
} |
|
|
|
}() |
|
|
|
if !template.ShouldSend(ctx) { |
|
|
|
log.Info("SendTemplateMsg should not Send.jobId=%d jobType=%s", ctx.Cloudbrain.ID, ctx.Cloudbrain.JobType) |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
openId := models.GetUserWechatOpenId(userId) |
|
|
|
if openId == "" { |
|
|
|
log.Error("Wechat openId not exist,userId=%d", userId) |
|
|
|
return errors.New("Wechat openId not exist") |
|
|
|
} |
|
|
|
req := TemplateMsgRequest{ |
|
|
@@ -56,5 +58,6 @@ func SendTemplateMsg(template Template, ctx *TemplateContext, userId int64) erro |
|
|
|
log.Error("SendTemplateMsg err. %v", err) |
|
|
|
return err |
|
|
|
} |
|
|
|
log.Info("SendTemplateMsg success") |
|
|
|
return nil |
|
|
|
} |