Can I see the recipients configured through contact input?


(Berkay) #1

Hey,
I would like to learn If I can see or log recipients configured through contact input? For instance, the code below shows “null” in the simulator, however, I’m curious about if this is possible in real applications which means I can get the numbers or names etc.

The documentation states “the users selected will be stored in a variable named recipients. This is just a simple list that we can pass into the sendNotificationToContacts() method.” However, it is not clear whether I can access the contact information such as number or name of the recipients.

def doorOpenHandler(evt) {
    log.debug "recipients configured: $recipients"

    def message = "The ${door.displayName} is open!"
    if (location.contactBookEnabled && recipients) {
        log.debug "Contact Book enabled!"
        sendNotificationToContacts(message, recipients)
    } else {
        log.debug "Contact Book not enabled"
        if (phone) {
            sendSms(phone, message)
        }
    }
}