fix send ByAll

This commit is contained in:
MyronZhang 2025-02-11 16:17:53 +08:00
parent 517f6ad211
commit 8f6b13c2fe

View File

@ -12,6 +12,16 @@ const (
) )
func Notify(by string, title string, description string, content string) error { func Notify(by string, title string, description string, content string) error {
if by == ByAll {
if err := SendEmail(title, config.RootUserEmail, content); err != nil {
return fmt.Errorf("failed to send email: %v", err)
}
if err := SendMessage(title, description, content); err != nil {
return fmt.Errorf("failed to send message: %v", err)
}
return nil
}
if by == ByEmail { if by == ByEmail {
return SendEmail(title, config.RootUserEmail, content) return SendEmail(title, config.RootUserEmail, content)
} }