Ejemplo n.º 1
0
        public void SendEmail(long[] UserID, string Message, string Subject)
        {
            //Get the User Email address
            SecurityPolicy.UserManager User = new SecurityPolicy.UserManager(CookiesWrapper.thisConnectionName, CookiesWrapper.thisUserID);
            List <string> email             = new List <string>();

            string[] Cell = new string[] { };

            foreach (long u in UserID)
            {
                var _with1 = User;

                _with1.Retrieve(u);
                email.Add(_with1.EmailAddress);

                SendMessage(u.ToString(), CookiesWrapper.thisUserID.ToString(), Subject, Message);
                ;
            }

            EmailSMSDistribution objCampaign = new EmailSMSDistribution(CookiesWrapper.thisConnectionName, CookiesWrapper.thisUserID);


            if (objCampaign.CreateCampaign((User.Retrieve(CookiesWrapper.thisUserID) ? User.EmailAddress : ""), Cell, email.ToArray(), Message, Subject, ""))
            {
            }
        }
Ejemplo n.º 2
0
        public bool SendEmail_SMS(string[] UserID, string[] Emailaddress, string[] CellNumbers, string Message, string Subject, long SendType)
        {
            EmailSMSDistribution objCampaign = new EmailSMSDistribution(CookiesWrapper.thisConnectionName, CookiesWrapper.thisUserID);

            //Get the User Email address
            if (SendType == 1)
            { //Send Email
                foreach (string e in UserID)
                {
                    SendMessage(e.ToString(), CookiesWrapper.thisUserID.ToString(), Subject, Message);
                }

                if (objCampaign.CreateCampaign("", CellNumbers, Emailaddress, Message, Subject, ""))
                {
                }

                return(true);
            }

            if (SendType == 2)   //Send SMS

            {
                if (SendSMS(CellNumbers, Message))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            if (SendType == 3) //Send Both SMS and Email
            {
                foreach (string e in UserID)
                {
                    SendMessage(e.ToString(), CookiesWrapper.thisUserID.ToString(), Subject, Message);
                }

                if (objCampaign.CreateCampaign("", CellNumbers, Emailaddress, Message, Subject, ""))
                {
                }

                if (SendSMS(CellNumbers, Message))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            return(false);
        }