|
@@ -1,7 +1,6 @@
|
|
|
package aliyun
|
|
|
|
|
|
import (
|
|
|
- "encoding/json"
|
|
|
"fmt"
|
|
|
cams20200606 "github.com/alibabacloud-go/cams-20200606/v2/client"
|
|
|
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
|
|
@@ -516,26 +515,19 @@ func DeleteChatappTemplate(name, language, templateType, templateCode string) (*
|
|
|
|
|
|
// SendChatappMessage 发送消息
|
|
|
// @see https://help.aliyun.com/zh/chatapp/developer-reference/api-cams-2020-06-06-sendchatappmessage
|
|
|
-func SendChatappMessage(stype, messageType, templateCode, lang, sfrom, sto, stext string) (*cams20200606.SendChatappMessageResponse, error) {
|
|
|
+func SendChatappMessage(stype, templateCode, lang, sfrom, sto string) (*cams20200606.SendChatappMessageResponse, error) {
|
|
|
client, _err := CreateCamsClient()
|
|
|
if _err != nil {
|
|
|
return nil, _err
|
|
|
}
|
|
|
|
|
|
- var content = map[string]interface{}{
|
|
|
- "text": stext,
|
|
|
- }
|
|
|
- scontext, _ := json.Marshal(content)
|
|
|
-
|
|
|
request := &cams20200606.SendChatappMessageRequest{
|
|
|
ChannelType: tea.String("whatsapp"),
|
|
|
Type: tea.String(stype),
|
|
|
- MessageType: tea.String(messageType),
|
|
|
TemplateCode: tea.String(templateCode),
|
|
|
Language: tea.String(lang),
|
|
|
From: tea.String(sfrom),
|
|
|
To: tea.String(sto),
|
|
|
- Content: tea.String(string(scontext)),
|
|
|
}
|
|
|
|
|
|
response, _err := client.SendChatappMessage(request)
|