|
@@ -102,7 +102,7 @@ func sendTemplateMsg(sendUrl string, sendMap map[string]interface{}, items []*wx
|
|
|
}
|
|
|
|
|
|
func toSendTemplateMsg(sendUrl string, data []byte) (err error) {
|
|
|
- utils.FileLog.Info("Send:%s", string(data))
|
|
|
+ utils.FileLog.Info("Send:"+string(data))
|
|
|
client := http.Client{}
|
|
|
resp, err := client.Post(sendUrl, "application/json", bytes.NewBuffer(data))
|
|
|
if err != nil {
|
|
@@ -111,7 +111,7 @@ func toSendTemplateMsg(sendUrl string, data []byte) (err error) {
|
|
|
defer resp.Body.Close()
|
|
|
|
|
|
body, _ := ioutil.ReadAll(resp.Body)
|
|
|
- utils.FileLog.Info("SendResult:%s", string(body))
|
|
|
+ utils.FileLog.Info("SendResult:"+string(body))
|
|
|
var templateResponse SendTemplateResponse
|
|
|
err = json.Unmarshal(body, &templateResponse)
|
|
|
if err != nil {
|
|
@@ -277,7 +277,7 @@ func SendWxMsgWithRoadshowPending(first, keyword1, keyword2, keyword3, keyword4,
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
go utils.SendEmail("发送模版消息失败"+time.Now().Format("2006-01-02 15:04:05"), msg+";Err:"+err.Error(), utils.EmailSendToUsers)
|
|
|
- utils.FileLog.Info("发送模版消息失败,Err:%s,%s", err.Error(), msg)
|
|
|
+ utils.FileLog.Info("发送模版消息失败,Err:"+err.Error()+msg)
|
|
|
}
|
|
|
if msg != "" {
|
|
|
utils.FileLog.Info("发送模版消息失败,msg:%s", msg)
|
|
@@ -321,6 +321,7 @@ func SendWxMsgWithRoadshowPending(first, keyword1, keyword2, keyword3, keyword4,
|
|
|
sendData["remark"] = map[string]interface{}{"value": remark, "color": "#173177"}
|
|
|
|
|
|
sendMap["template_id"] = utils.WxMsgTemplateIdWithRoadshowPending
|
|
|
+ sendMap["data"] = sendData
|
|
|
//小程序信息
|
|
|
if wxAppPath != "" {
|
|
|
sendMap["miniprogram"] = map[string]interface{}{"appid": utils.WxAppId2, "pagepath": wxAppPath}
|
|
@@ -380,6 +381,7 @@ func SendWxMsgWithRoadshowDeleteNotice(first, keyword1, keyword2, remark, wxAppP
|
|
|
if wxAppPath != "" {
|
|
|
sendMap["miniprogram"] = map[string]interface{}{"appid": utils.WxAppId2, "pagepath": wxAppPath}
|
|
|
}
|
|
|
+ sendMap["data"] = sendData
|
|
|
sendTemplateMsg(sendUrl, sendMap, openIdList)
|
|
|
}
|
|
|
utils.FileLog.Info("send end")
|