condensed alert code in class Alert to an alert function, to facilitate an if else case when receiving a request from the electric imp