creating eventsSince for ContactSensor and AeonKeyFobs + commenting runAfter method...
[smartthings-infrastructure.git] / Methods / sendNotificationToContacts.groovy
index cab016b57eac5f2708e2a1e98e06367fd2a8adad..06563c0878eb63d714a5dd88caffa1ea776a982b 100644 (file)
@@ -1,10 +1,20 @@
 /////////////////////////////////////////////////////////////////////
 ////sendNotificationToContacts(text, recipients)
-def sendNotificationToContacts(String S, List recipients) {
+def sendNotificationToContacts(String text, String recipients) {
        for (int i = 0;i < recipients.size();i++) {
-               for (int j = 0;j < location.CONTACTS.size();j++) {
-                       if (recipients[i] == location.CONTACTS[j]) {
-                               println("Sending \""+S+"\" to "+location.PhoneNums[j].toString())
+               for (int j = 0;j < location.contacts.size();j++) {
+                       if (recipients[i] == location.contacts[j]) {
+                               println("Sending \""+text+"\" to "+location.phoneNumbers[j].toString())
+                       }
+               }
+       }
+}
+
+def sendNotificationToContacts(String text, String recipients, LinkedHashMap metaData) {
+       for (int i = 0;i < recipients.size();i++) {
+               for (int j = 0;j < location.contacts.size();j++) {
+                       if (recipients[i] == location.contacts[j]) {
+                               println("Sending \""+text+"\" to "+location.phoneNumbers[j].toString())
                        }
                }
        }