mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2024-11-24 06:06:03 +03:00
14 lines
408 B
Go
14 lines
408 B
Go
package healthcheck
|
|
|
|
import retailcrm "github.com/retailcrm/api-client-go/v2"
|
|
|
|
func DefaultNotifyFunc(apiURL, apiKey, msg string) error {
|
|
client := retailcrm.New(apiURL, apiKey)
|
|
_, err := client.NotificationsSend(retailcrm.NotificationsSendRequest{
|
|
UserGroups: []retailcrm.UserGroupType{retailcrm.UserGroupSuperadmins},
|
|
Type: retailcrm.NotificationTypeError,
|
|
Message: msg,
|
|
})
|
|
return err
|
|
}
|