Skip to content

Commit

Permalink
open the DingTalk link in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Sep 18, 2021
1 parent 7d1d32a commit cc3d6a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion services/webhook/dingtalk.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package webhook

import (
"fmt"
"net/url"
"strings"

"code.gitea.io/gitea/models"
Expand Down Expand Up @@ -175,7 +176,10 @@ func createDingtalkPayload(title, text, singleTitle, singleURL string) *Dingtalk
Title: strings.TrimSpace(title),
HideAvatar: "0",
SingleTitle: singleTitle,
SingleURL: singleURL,

// https://developers.dingtalk.com/document/app/message-link-description
// 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.
SingleURL: "dingtalk://dingtalkclient/page/link?pc_slide=false&url=" + url.QueryEscape(singleURL),
},
}
}
Expand Down

0 comments on commit cc3d6a3

Please sign in to comment.