Skip to content

Commit 5c47061

Browse files
committed
allow multiple phone SMS recipients
1 parent 298b851 commit 5c47061

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

user-lock-manager.smartapp.groovy

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* User Lock Manager v4.0.10
2+
* User Lock Manager v4.1.0
33
*
44
* Copyright 2015 Erik Thayer
55
*
@@ -149,7 +149,8 @@ def notificationPage() {
149149
dynamicPage(name: "notificationPage", title: "Notification Settings") {
150150

151151
section {
152-
input(name: "phone", type: "phone", title: "Text This Number", description: "Phone number", required: false, submitOnChange: true)
152+
input(name: "phone", type: "text", title: "Text This Number", description: "Phone number", required: false, submitOnChange: true)
153+
paragraph "For multiple SMS recipients, separate phone numbers with a semicolon(;)"
153154
input(name: "notification", type: "bool", title: "Send A Push Notification", description: "Notification", required: false, submitOnChange: true)
154155
if (phone != null || notification || sendevent) {
155156
input(name: "notifyAccess", title: "on User Entry", type: "bool", required: false)
@@ -1282,7 +1283,15 @@ private sendMessage(msg) {
12821283
sendNotificationEvent(msg)
12831284
}
12841285
if (phone) {
1285-
sendSms(phone, msg)
1286+
if ( phone.indexOf(";") > 1){
1287+
def phones = phone.split(";")
1288+
for ( def i = 0; i < phones.size(); i++) {
1289+
sendSms(phones[i], msg)
1290+
}
1291+
}
1292+
else {
1293+
sendSms(phone, msg)
1294+
}
12861295
}
12871296
}
12881297

0 commit comments

Comments
 (0)