mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #15961 from gouqi11/fixAddNotifyTemplateFrom
fix(notify): 添加消息来源
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db/taskman"
|
||||
"yunion.io/x/onecloud/pkg/notify/models"
|
||||
"yunion.io/x/onecloud/pkg/notify/options"
|
||||
rpcapi "yunion.io/x/onecloud/pkg/notify/rpc/apis"
|
||||
"yunion.io/x/onecloud/pkg/util/logclient"
|
||||
)
|
||||
@@ -167,6 +168,14 @@ func (self *NotificationSendTask) OnInit(ctx context.Context, obj db.IStandalone
|
||||
if err != nil {
|
||||
self.taskFailed(ctx, notification, err.Error(), false)
|
||||
}
|
||||
|
||||
switch lang {
|
||||
case apis.TEMPLATE_LANG_CN:
|
||||
p.Message += "\n来自 " + options.Options.ApiServer
|
||||
case apis.TEMPLATE_LANG_EN:
|
||||
p.Message += "\nfrom " + options.Options.ApiServer
|
||||
}
|
||||
|
||||
// set status before send
|
||||
now := time.Now()
|
||||
for _, rn := range receivers {
|
||||
|
||||
Reference in New Issue
Block a user