Example #1
0
        public void SendMessage(string recepient, string sender, string message, bool isUnicode = false)
        {
            var exptTextingApi = new ExptTextingAPI();

            if (isUnicode)
            {
                XmlNode response = exptTextingApi.SendMultilingualSMS(_userId, _password, _apiKey, sender, recepient, message);
            }
            else
            {
                XmlNode response = exptTextingApi.SendSMS(_userId, _password, _apiKey, sender, recepient, message);
            }
        }
Example #2
0
        /// <summary>
        /// Sends SMS to the given number.
        /// </summary>
        /// <param name="phoneNumber">A string containing the phone number for sending SMS.</param>
        /// <param name="msgBody">A string containing message body text.</param>
        /// <param name="isUnicode">if true, message body contains unicode text; otherwise false.(Optional)</param>
        public override void SendSms(string[] phoneNumber, string msgBody, bool isUnicode = false)
        {
            const string success        = "SUCCESS";
            var          exptTextingApi = new ExptTextingAPI();
            XmlNode      response;

            if (isUnicode)
            {
                response = exptTextingApi.SendMultilingualSMS(_userId, _password, _apiKey, NeeoConstants.AppName, phoneNumber[0], msgBody);
            }
            else
            {
                response = exptTextingApi.SendSMS(_userId, _password, _apiKey, NeeoConstants.AppName, phoneNumber[0], msgBody);
            }
            if (response.ChildNodes[0].InnerText != success)
            {
                LogManager.CurrentInstance.ErrorLogger.LogError(
                    System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "Expert-Texting-Api - Phone # : \"" + phoneNumber[0] + "\" - " + response.ChildNodes[0].InnerText);
                throw new ApplicationException(CustomHttpStatusCode.SmsApiException.ToString("D"));
            }
        }