Skip to content

Commit cc3d6a3

Browse files
committed
open the DingTalk link in browser
1 parent 7d1d32a commit cc3d6a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

services/webhook/dingtalk.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package webhook
66

77
import (
88
"fmt"
9+
"net/url"
910
"strings"
1011

1112
"code.gitea.io/gitea/models"
@@ -175,7 +176,10 @@ func createDingtalkPayload(title, text, singleTitle, singleURL string) *Dingtalk
175176
Title: strings.TrimSpace(title),
176177
HideAvatar: "0",
177178
SingleTitle: singleTitle,
178-
SingleURL: singleURL,
179+
180+
// https://developers.dingtalk.com/document/app/message-link-description
181+
// to open the link in browser, we should use this URL, otherwise the page is displayed inside DingTalk client, very difficult to visit non-public URLs.
182+
SingleURL: "dingtalk://dingtalkclient/page/link?pc_slide=false&url=" + url.QueryEscape(singleURL),
179183
},
180184
}
181185
}

0 commit comments

Comments
 (0)