mirror of https://github.com/statping/statping
Update Online Message for Twilio Notifier
parent
a9b559262a
commit
786bfe75fc
|
@ -20,6 +20,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"github.com/hunterlong/statping/core/notifier"
|
||||
"github.com/hunterlong/statping/core"
|
||||
"github.com/hunterlong/statping/types"
|
||||
"github.com/hunterlong/statping/utils"
|
||||
"net/url"
|
||||
|
@ -109,7 +110,12 @@ func (u *twilio) OnFailure(s *types.Service, f *types.Failure) {
|
|||
func (u *twilio) OnSuccess(s *types.Service) {
|
||||
if !s.Online {
|
||||
u.ResetUniqueQueue(fmt.Sprintf("service_%v", s.Id))
|
||||
msg := fmt.Sprintf("Your service '%v' is back online!", s.Name)
|
||||
var msg string
|
||||
if core.CoreApp.UpdateNotify.Bool {
|
||||
msg = core.ReturnService(s).SmallText()
|
||||
} else {
|
||||
msg = fmt.Sprintf("Your Service %v is Back Online", s.Name)
|
||||
}
|
||||
u.AddQueue(fmt.Sprintf("service_%v", s.Id), msg)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue