Closed valexandersaulys closed 6 years ago
Sorry for the late answer. It would require some source code edits.
If anyone needs something similar, you can achieve it buy updating options_with_handler.go
file like this;
diff --git a/options_with_handler.go b/options_with_handler.go
index 3225beb..6454dcc 100644
--- a/options_with_handler.go
+++ b/options_with_handler.go
@@ -89,12 +89,14 @@ func sendMessage(o *options, alert []byte) {
if err == nil {
body = "\"" + body + "\"" + " alert starts at " + parsedStartsAt.Format(time.RFC1123)
}
-
- message, err := twilio.NewMessage(c, o.Sender, o.Receiver, twilio.Body(body))
- if err != nil {
- log.Error(err)
- } else {
- log.Infof("Message %s", message.Status)
+ receivers := strings.Split(o.Receiver, ",")
+ for _, receiver := range receivers {
+ message, err := twilio.NewMessage(c, o.Sender, receiver, twilio.Body(body))
+ if err != nil {
+ log.Error(err)
+ } else {
+ log.Infof("Message %s", message.Status)
+ }
}
} else {
log.Error("Bad format")
Is there any reason this can't be set up to send to multiple numbers?
Curious if it would be a simple thing or require some source code edits.
Thanks in advance!