feat(lark): supports custom domain #1027

Close #1027
This commit is contained in:
Jacky 2025-05-09 08:15:02 +08:00
parent 7f6399a718
commit c59b81e4c7
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
20 changed files with 1619 additions and 2164 deletions

View file

@ -10,6 +10,7 @@ import (
// @external_notifier(Lark Custom)
type LarkCustom struct {
Domain string `json:"domain" title:"Domain"`
AppID string `json:"app_id" title:"App ID"`
AppSecret string `json:"app_secret" title:"App Secret"`
OpenID string `json:"open_id" title:"Open ID"`
@ -38,6 +39,13 @@ func init() {
lark.Email(larkCustomConfig.Email),
lark.ChatID(larkCustomConfig.ChatID),
)
if larkCustomConfig.Domain != "" {
larkCustomAppService.AddReceivers(
lark.Domain(larkCustomConfig.Domain),
)
}
return larkCustomAppService.Send(ctx, msg.GetTitle(n.Language), msg.GetContent(n.Language))
})
}