From af2ea04442726085e6c4726057813c1a502845ed Mon Sep 17 00:00:00 2001 From: Juan Pablo Risso Date: Tue, 6 Sep 2016 12:04:26 -0400 Subject: [PATCH] CREX-5826 - 2 SMS bug fix (#1193) options.method = 'none' & variable name update Revert variable name --- .../notify-me-when.src/notify-me-when.groovy | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/smartapps/smartthings/notify-me-when.src/notify-me-when.groovy b/smartapps/smartthings/notify-me-when.src/notify-me-when.groovy index 9a55db2..1d8a055 100644 --- a/smartapps/smartthings/notify-me-when.src/notify-me-when.groovy +++ b/smartapps/smartthings/notify-me-when.src/notify-me-when.groovy @@ -111,16 +111,23 @@ private sendMessage(evt) { if (location.contactBookEnabled) { sendNotificationToContacts(msg, recipients, options) } else { - if (pushAndPhone != 'No') { - log.debug 'sending push' - options.method = 'push' - sendNotification(msg, options) - } if (phone) { options.phone = phone - log.debug 'sending SMS' - sendNotification(msg, options) + if (pushAndPhone != 'No') { + log.debug 'Sending push and SMS' + options.method = 'both' + else { + log.debug 'Sending SMS' + options.method = 'phone' + } + else if (pushAndPhone != 'No') { + log.debug 'Sending push' + options.method = 'push' + } else { + log.debug 'Sending nothing' + options.method = 'none' } + sendNotification(msg, options) } if (frequency) { state[evt.deviceId] = now()