Beispiel #1
0
        private void SendAlerts(double currenttemp, int alertval)
        {
            notificationTimer.Start();

            if (chkEmail.Checked)
            {
                var emailsent = emailalertclient.SendMail("*****@*****.**", "Alert: SetTemparature Reached", $" set temparature of {currenttemp} is reached");

                if (emailsent)
                {
                    queue.Enqueue("Alert Email Sent");
                }
            }

            if (chkSMS.Checked)
            {
                SMSAlert.SendSMS($"Alert : Your set temparature reached {currenttemp}", "+6597208220");
                queue.Enqueue("Alert SMS Sent");
            }

            if (chkTelegram.Checked)
            {
                TelegramBot.SendAlert($"Alert : Your set temparature reached {currenttemp}");
                queue.Enqueue("Alert Telegram Sent");
            }
        }