Hi I have two if statements one after the other but only the first one will run when either device is off by name. I need the next if hs.isOffbyName (Status Mustang) to run as well. any one see a better way to do this?
**Note I have two different Toaddresses and conditions that I need to run.
see below:
**Note I have two different Toaddresses and conditions that I need to run.
see below:
PHP Code:
'**********************************************************************************************
If notify Then
'***********************************************************************************************
'PAP Auto Status deactivates email of CNN news when device status Is On
If hs.IsOffByName ("Status MKZ")Or hs.IsOffByName ("Status GXP")Then
hs.SendEmail(TOaddress, FROMaddress, subject, msg)
dbg("email notification to Paul been sent")
'**********************************************************************************************
if hs.IsOffByName ("Status Mustang")Then
hs.SendEmail(TOaddress2, FROMaddress, subject, msg)
dbg("email notification to Alice has been sent")
'***********************************************************************************************
'PAP Sends CNN Alert in a IM
IM_Connector.SendMessage(IMaddress, subject & msg & chr(13))
dbg("IM notification has been sent")
'***********************************************************************************************
End If
End If
End If
End Sub
Comment