Esempio n. 1
0
        public static bool ConfirmingNewPasswordEmail(string recipient, string applicationName, string name, string newPassword)
        {
            Hashtable templateVars = new Hashtable();

            templateVars.Add("ApplicationName", applicationName);
            templateVars.Add("name", name);
            templateVars.Add("newPassword", newPassword);

            Parser parser = new Parser();

            parser = new Parser(HostingEnvironment.MapPath("~/" + UIConfig.MailBodyFolderPath + "/ConfirmingNewPasswordMail.htm"), templateVars);

            string mailBody = parser.Parse();

            //string mailBody = "You are Successfully Registered";

            string subject = "New password for Group.Direct and GroupConnect";

            string from = UIConfig.MailAddressFrom;

            return SendEmail(subject, mailBody, from, recipient);
        }
Esempio n. 2
0
        public static bool ConfirmCompanySignupRequestAcceptance(string emailAddress, string userName, string password)
        {
            string applicationName = ConfigurationManager.AppSettings["ApplicationName"];

            Hashtable templateVars = new Hashtable();
            templateVars.Add("ApplicationName", applicationName);
            templateVars.Add("userName", userName);
            templateVars.Add("password", password);

            Parser parser = new Parser();

            parser = new Parser(HostingEnvironment.MapPath("~/" + UIConfig.MailBodyFolderPath + "/ConfirmCompanyAcceptance.htm"), templateVars);

            string mailBody = parser.Parse();

            //string mailBody = "You are Successfully Registered";

            string subject = "Welcome to Group.Direct App Suite!";

            string from = UIConfig.MailAddressFrom;

            return SendEmail(subject, mailBody, from, emailAddress);
        }
Esempio n. 3
0
        /// <summary>
        /// Parse all blocks in template
        /// </summary>
        private void ParseBlocks()
        {
            //int idxPrevious = 0;
            int idxCurrent = 0;
            while ((idxCurrent = this._strTemplateBlock.IndexOf(this.BlockTagBeginBegin, idxCurrent)) != -1)
            {
                string BlockName;
                int idxBlockBeginBegin, idxBlockBeginEnd, idxBlockEndBegin;

                idxBlockBeginBegin = idxCurrent;
                idxCurrent += this.BlockTagBeginBegin.Length;

                // Searching for BlockBeginEnd Index

                idxBlockBeginEnd = this._strTemplateBlock.IndexOf(this.BlockTagBeginEnd, idxCurrent);
                if (idxBlockBeginEnd == -1) throw new Exception("Could not find BlockTagBeginEnd");

                // Getting Block Name

                BlockName = this._strTemplateBlock.Substring(idxCurrent, (idxBlockBeginEnd - idxCurrent));
                idxCurrent = idxBlockBeginEnd + this.BlockTagBeginEnd.Length;

                // Getting End of Block index

                string EndBlockStatment = this.BlockTagEndBegin + BlockName + this.BlockTagEndEnd;
                idxBlockEndBegin = this._strTemplateBlock.IndexOf(EndBlockStatment, idxCurrent);
                if (idxBlockEndBegin == -1) throw new Exception("Could not find End of Block with name '" + BlockName + "'");

                // Add Block to Dictionary

                Parser block = new Parser();
                block.TemplateBlock = this._strTemplateBlock.Substring(idxCurrent, (idxBlockEndBegin - idxCurrent));
                this._Blocks.Add(BlockName, block);

                // Remove Block Declaration From Template

                this._strTemplateBlock = this._strTemplateBlock.Remove(idxBlockBeginBegin, (idxBlockEndBegin - idxBlockBeginBegin));

                idxCurrent = idxBlockBeginBegin;
            }
        }
Esempio n. 4
0
        public static bool RejectCompanySignupRequestEmail(string emailAddress)
        {
            string applicationName = ConfigurationManager.AppSettings["ApplicationName"];

            Hashtable templateVars = new Hashtable();
            templateVars.Add("ApplicationName", applicationName);

            Parser parser = new Parser();

            parser = new Parser(HostingEnvironment.MapPath("~/" + UIConfig.MailBodyFolderPath + "/RejectCompanySignupRequest.htm"), templateVars);

            string mailBody = parser.Parse();

            //string mailBody = "You are Successfully Registered";

            string subject = "Your Company Signup Request has been Rejected!";

            string from = UIConfig.MailAddressFrom;

            return SendEmail(subject, mailBody, from, emailAddress);
        }
Esempio n. 5
0
        public static bool SendSignupRequestMail(string recipient, string name, string activatiCode)
        {
            string applicationName = ConfigurationManager.AppSettings["ApplicationName"];

            Hashtable templateVars = new Hashtable();
            templateVars.Add("ApplicationName", applicationName);
            templateVars.Add("email", recipient);
            templateVars.Add("name", name);
            templateVars.Add("activationCode", activatiCode);

            Parser parser = new Parser();

            parser = new Parser(HostingEnvironment.MapPath("~/" + UIConfig.MailBodyFolderPath + "/SignupRequestMail.htm"), templateVars);

            string mailBody = parser.Parse();

            //string mailBody = "You are Successfully Registered";

            string subject = "Activate your GroupConnect Apps account";

            string from = UIConfig.MailAddressFrom;

            return SendEmail(subject, mailBody, from, recipient);
        }
Esempio n. 6
0
        public static bool SendPasswordResetTokenEmail(string recipient, string applicationName, string name, string token, string userName)
        {
            Hashtable templateVars = new Hashtable();

            templateVars.Add("ApplicationName", applicationName);
            templateVars.Add("name", name);
            templateVars.Add("token", token);
            templateVars.Add("userName", userName);

            Parser parser = new Parser();

            parser = new Parser(HostingEnvironment.MapPath("~/" + UIConfig.MailBodyFolderPath + "/PasswordResetTokenMail.htm"), templateVars);

            string mailBody = parser.Parse();

            //string mailBody = "You are Successfully Registered";

            string subject = "Group.Direct and GroupConnect Apps password reset";

            string from = UIConfig.MailAddressFrom;

            return SendEmail(subject, mailBody, from, recipient);
        }
Esempio n. 7
0
        public static bool SendConnectionInvitationMail(string recipient, string name, string requesterName)
        {
            string applicationName = ConfigurationManager.AppSettings["ApplicationName"];

            string url = ConfigurationManager.AppSettings["GroupDirectSignupUrl"];

            Hashtable templateVars = new Hashtable();
            templateVars.Add("ApplicationName", applicationName);
            templateVars.Add("email", recipient);
            templateVars.Add("name", name);
            templateVars.Add("requester", requesterName);
            templateVars.Add("url", url);

            Parser parser = new Parser();

            parser = new Parser(HostingEnvironment.MapPath("~/" + UIConfig.MailBodyFolderPath + "/ConnectInvitationMail.htm"), templateVars);

            string mailBody = parser.Parse();

            //string mailBody = "You are Successfully Registered";

            string subject = requesterName + " invited you to connect on group.direct";

            string from = UIConfig.MailAddressFrom;

            return SendEmail(subject, mailBody, from, recipient);
        }
Esempio n. 8
0
        public static bool SendCompanySignupRequestEmailToSuperAdmin(string emailAddress, string companyName, string address, string contactPerson, string contactEmail)
        {
            string applicationName = ConfigurationManager.AppSettings["ApplicationName"];

            Hashtable templateVars = new Hashtable();
            templateVars.Add("ApplicationName", applicationName);
            templateVars.Add("companyName", companyName);
            templateVars.Add("address", address);
            templateVars.Add("contactperson", contactPerson);
            templateVars.Add("emailaddress", contactEmail);

            Parser parser = new Parser();

            parser = new Parser(HostingEnvironment.MapPath("~/" + UIConfig.MailBodyFolderPath + "/CompanySignupRequestEmail.htm"), templateVars);

            string mailBody = parser.Parse();

            //string mailBody = "You are Successfully Registered";

            string subject = "New Company Signup Request!";

            string from = UIConfig.MailAddressFrom;

            return SendEmail(subject, mailBody, from, emailAddress);
        }
Esempio n. 9
0
        //public static bool SendRegistrationEmail(string recipient, string applicationName, string name, string userName, string password, int userType)
        //{
        //    Hashtable templateVars = new Hashtable();
        //    templateVars.Add("ApplicationName", applicationName);
        //    templateVars.Add("name", name);
        //    templateVars.Add("userName", userName);
        //    Parser parser = new Parser();
        //    if (userType == Convert.ToInt32(Enums.UserType.EmailUser))
        //    {
        //        templateVars.Add("userType", "email");
        //        templateVars.Add("password", password);
        //        parser = new Parser(HostingEnvironment.MapPath("~/" + Config.MailBodyFolderPath + "/UserRegistrationAsEmailUser.htm"), templateVars);
        //    }
        //    if (userType == Convert.ToInt32(Enums.UserType.FacebookUser))
        //    {
        //        templateVars.Add("userType", "facebook");
        //        templateVars.Add("login", "Facebook Login Id");
        //        parser = new Parser(HostingEnvironment.MapPath("~/" + Config.MailBodyFolderPath + "/UserRegistrationAsOtherUser.htm"), templateVars);
        //    }
        //    if (userType == Convert.ToInt32(Enums.UserType.Twitteruser))
        //    {
        //        templateVars.Add("userType", "twitter");
        //        templateVars.Add("login", "Twitter Login Id");
        //        parser = new Parser(HostingEnvironment.MapPath("~/" + Config.MailBodyFolderPath + "/UserRegistrationAsOtherUser.htm"), templateVars);
        //    }
        //    string mailBody = parser.Parse();
        //    //string mailBody = "You are Successfully Registered";
        //    string subject = "User Registration";
        //    string from = Config.MailAddressFrom;
        //    return SendEmail(subject, mailBody, from, recipient);
        //}
        public static bool SendCompanyInvitationCode(string senderName, string recipient,string activationCode,string companyName)
        {
            string applicationName = ConfigurationManager.AppSettings["ApplicationName"];

            string siteurl = ConfigurationManager.AppSettings["gdsiteurl"];

            Hashtable templateVars = new Hashtable();
            templateVars.Add("ApplicationName", applicationName);
            templateVars.Add("email", recipient);
            templateVars.Add("companyName", companyName);
            templateVars.Add("activationCode", activationCode);
            templateVars.Add("senderName", senderName);

            Parser parser = new Parser();

            parser = new Parser(HostingEnvironment.MapPath("~/" + UIConfig.MailBodyFolderPath + "/CompanyInvitationCode.htm"), templateVars);

            string mailBody = parser.Parse();

            //string mailBody = "You are Successfully Registered";

            string subject = senderName + " invited you to join " + companyName + " on " + applicationName;

            string from = UIConfig.MailAddressFrom;

            return SendEmail(subject, mailBody, from, recipient);
        }