welcomeCode
This commit is contained in:
parent
616f26f45b
commit
f37bcd9878
|
@ -93,6 +93,8 @@ type CustomerEvent struct {
|
||||||
ChangeType int `json:"change_type"`
|
ChangeType int `json:"change_type"`
|
||||||
OldServicerUserid string `json:"old_servicer_userid"`
|
OldServicerUserid string `json:"old_servicer_userid"`
|
||||||
NewServicerUserid string `json:"new_servicer_userid"`
|
NewServicerUserid string `json:"new_servicer_userid"`
|
||||||
|
MsgCode string `json:"msg_code"`
|
||||||
|
WelcomeCode string `json:"welcome_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CustomerInfo struct {
|
type CustomerInfo struct {
|
||||||
|
@ -263,6 +265,26 @@ func (a *AppCustomer) SendCustomerFile(openKfId, toUser, mediaId string) error {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *AppCustomer) SendCustomerWelcome(code, message string) error {
|
||||||
|
reqUrl := fmt.Sprintf("https://qyapi.weixin.qq.com/cgi-bin/kf/send_msg_on_event?access_token=?access_token=%s", a.GetToken())
|
||||||
|
params := make(map[string]interface{})
|
||||||
|
params["code"] = code
|
||||||
|
|
||||||
|
params["text"] = map[string]interface{}{
|
||||||
|
"content": message,
|
||||||
|
}
|
||||||
|
reqBody, _ := json.Marshal(params)
|
||||||
|
rspBody, err := util.HttpPostJson(reqUrl, nil, reqBody)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_, err = a.GetResult(rspBody)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (a *AppCustomer) sendCustomerMessage(openKfId, toUser, msgtype string, data interface{}) error {
|
func (a *AppCustomer) sendCustomerMessage(openKfId, toUser, msgtype string, data interface{}) error {
|
||||||
reqUrl := fmt.Sprintf("https://qyapi.weixin.qq.com/cgi-bin/kf/send_msg?access_token=%s", a.GetToken())
|
reqUrl := fmt.Sprintf("https://qyapi.weixin.qq.com/cgi-bin/kf/send_msg?access_token=%s", a.GetToken())
|
||||||
params := make(map[string]interface{})
|
params := make(map[string]interface{})
|
||||||
|
|
Loading…
Reference in New Issue