rdluck 4 years ago
parent
commit
ad7407d68e
2 changed files with 13 additions and 1 deletions
  1. 8 1
      services/wechat_send_msg.go
  2. 5 0
      utils/config.go

+ 8 - 1
services/wechat_send_msg.go

@@ -99,7 +99,7 @@ func SendInterviewApplyCancelTemplateMsg(realName, companyName, mobile, articleT
 }
 
 //权限申请
-func SendPermissionApplyTemplateMsg(realName, companyName, mobile, openId,applyMethod string) (err error) {
+func SendPermissionApplyTemplateMsg(realName, companyName, mobile, openId, applyMethod string) (err error) {
 	var msg string
 	defer func() {
 		if err != nil {
@@ -168,6 +168,7 @@ func toSendTemplateMsg(sendUrl string, data []byte) (err error) {
 	body, _ := ioutil.ReadAll(resp.Body)
 	var templateResponse SendTemplateResponse
 	err = json.Unmarshal(body, &templateResponse)
+	utils.FileLog.Info("SendResult %s:", string(body))
 	if err != nil {
 		utils.FileLog.Info("SendResult Unmarshal Err:%s", err.Error())
 		return err
@@ -180,3 +181,9 @@ type SendTemplateResponse struct {
 	Errmsg  string `json:"errmsg"`
 	MsgID   int    `json:"msgid"`
 }
+
+func ini123() {
+	fmt.Println("start")
+	SendPermissionApplyTemplateMsg("沈涛", "弘则", "18767183922", "oW3Gts7Ji6Ngv7v2pLeLOFaajfus", "潜在客户申请")
+	fmt.Println("end")
+}

+ 5 - 0
utils/config.go

@@ -50,6 +50,10 @@ func init() {
 		WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
 		WxId = "gh_a9d3744e1072"
 
+		WxMsgTemplateIdApply = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk"
+		WxMsgTemplateIdApplyCancel = "iEi4YRHwcPbc2PSEF1pptc39H4NsAJPrUIPEk2ynwiA"
+		WxMsgTemplateIdPermissionApply = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk"
+
 		WxPublicAppId = "wx4a844c734d8c8e56"
 		WxPublicAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
 		WxPublicId = "gh_b67e0049fb8c"
@@ -60,6 +64,7 @@ func init() {
 		WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
 		WxId = "gh_a9d3744e1072"
 
+		//模板消息ID
 		WxMsgTemplateIdApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
 		WxMsgTemplateIdApplyCancel = "UU_d7ks0XZBnWg2xFzxL9Heilm4kisX39K7dr4SDdO8"
 		WxMsgTemplateIdPermissionApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"