Пример #1
0
 private int SaveToEmailJob(string toEmail)
 {
     EmailBE objEmailBE = new EmailBE();
     EmailDA objEmailDA = new EmailDA();
     objEmailBE.isToEmailRef = false;
     objEmailBE.RequestStatus = "No-delay";
     objEmailBE.RequestType = "Presenter Contact Emailing"; // "Webinar Registrant Emailing";
     objEmailBE.Subject = "Webinar Presenter Contact";
     objEmailBE.SubmittedBy = Convert.ToInt32(Session["UserID"]);
     objEmailBE.ToEmail = toEmail;
     objEmailBE.FromEmail = Session["EmailID"].ToString();
     objEmailBE.EmailContent = objEmailing.getHTMLFormattedWebinarPresenterContact("Presenter Contact", Convert.ToInt32(hWebinarID.Value));
     return objEmailDA.SaveEmailRequest(objEmailBE);
 }
Пример #2
0
        protected void btnReview_Click(object sender, EventArgs e)
        {
            lblError1.Text = "";
            if (txtReviewerEmail.Text.Trim() != "")
            {
                if (objUtil.isEmailsValid(txtReviewerEmail.Text.Trim(), new char[] { ';' }))
                {
                    EmailBE objEmailBE = new EmailBE();
                    EmailDA objEmailDA = new EmailDA();
                    int emlReqID = 0;
                    objEmailBE.isToEmailRef = true;
                    objEmailBE.RequestStatus = "No-delay";
                    objEmailBE.RequestType = "Thank You for registering"; // "Webinar Registrant Emailing";
                    objEmailBE.Subject = "Thank You for registering content for review";         // txtSubject.Text;
                    objEmailBE.SubmittedBy = Convert.ToInt32(Session["UserID"]);
                    objEmailBE.ToEmail = "";
                    objEmailBE.FromEmail = Session["EmailID"].ToString();
                    objEmailBE.EmailContent = "<b>Following are the content for review</b><br><br>" + redtThankContent.Content;
                    emlReqID = objEmailDA.SaveEmailRequest(objEmailBE);
                    objEmailDA.SaveToEmail(new EmailTo
                                {
                                    EmailRequestID = emlReqID,
                                    ToEmails = txtReviewerEmail.Text.Trim(),
                                    ToType = ""
                                });

                    lblError1.Text = "Emailed to reviewer(s)";
                }
                else
                {
                    lblError1.Text = "One or more entered reviewer's email is invalid";
                }
            }
            else
                lblError1.Text = "Reviewer email(s) is missing";
        }
Пример #3
0
 private int SaveEmail(string requestType, string subject, string toEmail, string emailContent)
 {
     EmailBE objEmailBE = new EmailBE();
     EmailDA objEmailDA = new EmailDA();
     objEmailBE.isToEmailRef = true;
     objEmailBE.RequestStatus = "No-delay";
     objEmailBE.RequestType = requestType; // "Webinar Registrant Emailing";
     objEmailBE.Subject = subject;         // txtSubject.Text;
     objEmailBE.SubmittedBy = Convert.ToInt32(Session["UserID"]);
     objEmailBE.ToEmail = toEmail;
     objEmailBE.FromEmail = Session["EmailID"].ToString();
     objEmailBE.EmailContent = emailContent;
     return objEmailDA.SaveEmailRequest(objEmailBE);
 }
Пример #4
0
        private int SaveToEmailJob(string emailID)
        {
            EmailBE objEmailBE = new EmailBE();
            EmailDA objEmailDA = new EmailDA();
            EmailApp objEmailing = new EmailApp();

            string emlContent = objEmailing.getHTMLFormattedPasswdChangeNotify(emailID);
            objEmailBE.isToEmailRef = false;
            objEmailBE.RequestStatus = "No-delay";
            objEmailBE.RequestType = "Password Changed";
            objEmailBE.Subject = "Password Changed Notification";
            objEmailBE.SubmittedBy = 0;
            objEmailBE.ToEmail = emailID;
            objEmailBE.FromEmail = "*****@*****.**";
            objEmailBE.EmailContent = emlContent;
            return objEmailDA.SaveEmailRequest(objEmailBE);
        }
Пример #5
0
        private int SaveToEmailJob(string emailID, string genPasswd)
        {
            EmailBE objEmailBE = new EmailBE();
            EmailDA objEmailDA = new EmailDA();
            EmailApp objEmailing = new EmailApp();

            string emlContent = objEmailing.getHTMLFormattedNewAccountNotify(emailID, genPasswd, DateTime.Now.ToString());
            objEmailBE.isToEmailRef = false;
            objEmailBE.RequestStatus = "No-delay";
            objEmailBE.RequestType = "New User Account";
            objEmailBE.Subject = "Welcome to SnapSession!";
            objEmailBE.SubmittedBy = Convert.ToInt32(Session["UserID"]);
            objEmailBE.ToEmail = emailID;
            objEmailBE.FromEmail = "*****@*****.**";
            objEmailBE.EmailContent = emlContent;
            return objEmailDA.SaveEmailRequest(objEmailBE);
        }
Пример #6
0
        public int SaveEmailRequest(EmailBE objEmailBE)
        {
            int requestID = 0;
            try
            {
                using (MySqlConnection sqlCon = new MySqlConnection(Constant.EBirdConnectionString))
                {
                    //MySqlCommand sqlCmd = new MySqlCommand(DBEmailQuery.sqlRequestInsert, sqlCon);
                    MySqlCommand sqlCmd = new MySqlCommand("spSaveEmailingRequest", sqlCon);

                    sqlCon.Open();
                    sqlCmd.CommandType = CommandType.StoredProcedure;

                    sqlCmd.Parameters.Add(new MySqlParameter("pMailType", objEmailBE.RequestType));
                    sqlCmd.Parameters.Add(new MySqlParameter("pSubject", objEmailBE.Subject));
                    sqlCmd.Parameters.Add(new MySqlParameter("pEmailContent", objEmailBE.EmailContent));
                    sqlCmd.Parameters.Add(new MySqlParameter("pFromEmail", objEmailBE.FromEmail));
                    sqlCmd.Parameters.Add(new MySqlParameter("pFromName", objEmailBE.FromName));
                    sqlCmd.Parameters.Add(new MySqlParameter("pIsToEmailRef", objEmailBE.isToEmailRef));
                    sqlCmd.Parameters.Add(new MySqlParameter("pToEmail", objEmailBE.ToEmail));
                    sqlCmd.Parameters.Add(new MySqlParameter("pToEmailName", objEmailBE.ToEmailName));
                    sqlCmd.Parameters.Add(new MySqlParameter("pSubmittedBy", objEmailBE.SubmittedBy));
                    sqlCmd.Parameters.Add(new MySqlParameter("pRequestStatus", objEmailBE.RequestStatus));
                    //sqlCmd.ExecuteNonQuery();

                    //sqlCmd = new MySqlCommand("SELECT LAST_INSERT_ID()", sqlCon);
                    //sqlCmd.CommandType = CommandType.Text;

                    MySqlDataReader reader = sqlCmd.ExecuteReader();
                    if (reader.HasRows)
                    {
                        reader.Read();
                        requestID = Convert.ToInt32(reader.GetValue(0));
                    }
                    reader.Close();
                    reader = null;
                    sqlCon.Close();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return requestID;
        }
 private int SaveToEmailJob(string toEmail, string chkTyp)
 {
     EmailBE objEmailBE = new EmailBE();
     EmailDA objEmailDA = new EmailDA();
     objEmailBE.isToEmailRef = false;
     objEmailBE.RequestStatus = "No-delay";
     objEmailBE.RequestType = hReqType.Value; // "Webinar Registrant Emailing";
     objEmailBE.Subject = chkTyp + " : " + txtSubject.Text;
     objEmailBE.SubmittedBy = Convert.ToInt32(Session["UserID"]);
     objEmailBE.ToEmail = toEmail;
     objEmailBE.FromEmail = Session["EmailID"].ToString();
     objEmailBE.EmailContent = objEmailing.getFormedEmailContent(redtRemEmail.Content, hReqType.Value, Convert.ToInt32(hWebinarID.Value));
     return objEmailDA.SaveEmailRequest(objEmailBE);
 }
        //private EmailBE GetWebinarContent(string ReqType, int webinarID)
        //{
        //    EmailBE objEmailBE = new EmailBE();
        //    string tplValue = "";
        //    if (objWBEmail.Count > 0)
        //    {
        //        objEmailBE.EmailContent = objWBEmail[0].EmailContent;
        //        objEmailBE.FromEmail = "";
        //        objEmailBE.RequestType = objWBEmail[0].RequestType;
        //        objEmailBE.Subject = objWBEmail[0].Subject;
        //    }
        //}
        private EmailBE GetWebinarContent(string ReqType, string emailSubject, string tplFileName)
        {
            EmailBE objEmailBE = new EmailBE();

            string tplValue = "";
            hWebinarID.Value = Request["ID"].ToString();
            List<WebinarEmailBE> objWBEmail = objEmailDA.GetWebinarEmail(Convert.ToInt32(hWebinarID.Value), ReqType);
            if (objWBEmail.Count == 0)
            {
                TemplateMgmt objTemplateMgmt = new TemplateMgmt();
                tplValue = objTemplateMgmt.GetReminderEmail(Constant.DocTemplate + tplFileName);
                SaveEmail(tplValue, emailSubject, ReqType, Convert.ToInt32(hWebinarID.Value));
                objEmailBE.EmailContent = tplValue;
                objEmailBE.FromEmail = "";
                objEmailBE.RequestType = ReqType;
                objEmailBE.Subject = emailSubject;
            }
            else
            {
                objEmailBE.EmailContent = objWBEmail[0].EmailContent;
                objEmailBE.FromEmail = "";
                objEmailBE.RequestType = objWBEmail[0].RequestType;
                objEmailBE.Subject = objWBEmail[0].Subject;
            }
            return objEmailBE;
        }
Пример #9
0
        private int SaveToEmailJob(string toEmail, string reqTyp)
        {
            EmailBE objEmailBE = new EmailBE();
            EmailDA objEmailDA = new EmailDA();
            EmailApp objEmailing = new EmailApp();

            string emlContent = string.Empty;
            string frEmail = string.Empty;
            string subject = string.Empty;
            switch (reqTyp)
            {
                case "Webinar Invitation":
                    int webinarID = Convert.ToInt32(hWebinarID.Value);
                    List<WebinarEmailBE> objWBEmail = new List<WebinarEmailBE>();
                    objWBEmail = objEmailDA.GetWebinarEmail(webinarID, reqTyp);
                    emlContent = objEmailing.getHTMLFormattedEmailContent(objWBEmail[0].EmailContent, objWBEmail[0].RequestType, webinarID);
                    emlContent = objEmailing.getFormedEmailContent(emlContent, reqTyp, webinarID);
                    frEmail = Session["EmailID"].ToString();
                    subject = "Webinar Invitation";
                    break;
                case "Campaign Tracking":
                    emlContent = objEmailing.getHTMLFormattedGeneralEmail(reqTyp, Convert.ToInt32(Session["Client_LanguageID"]));
                    frEmail = "*****@*****.**";
                    subject = "SnapSession Webinar Campaign Tracking";
                    break;
                case "Connect Your Registration":
                    emlContent = objEmailing.getHTMLFormattedGeneralEmail(reqTyp, Convert.ToInt32(Session["Client_LanguageID"]));
                    frEmail = "*****@*****.**";
                    subject = "SnapSession Connect Your Registration";
                    break;
            }

            objEmailBE.isToEmailRef = false;
            objEmailBE.RequestStatus = "No-delay";
            objEmailBE.RequestType = reqTyp;
            objEmailBE.Subject = subject;
            objEmailBE.SubmittedBy = Convert.ToInt32(Session["UserID"]);
            objEmailBE.ToEmail = toEmail;
            objEmailBE.FromEmail = frEmail;
            objEmailBE.EmailContent = emlContent;
            return objEmailDA.SaveEmailRequest(objEmailBE);
        }
Пример #10
0
        protected void btnSendEmail_Click(object sender, EventArgs e)
        {
            lblError.Text = "";
            if (txtSubject.Text == "" || redEmailRegistrants.Content == "")
                lblError.Text = "Subject or email content cannot be empty";
            else
            {
                if (chkDidNotAttend.Checked || chkAttended.Checked || chkAttendedLive.Checked ||
                      chkOnDemand.Checked || chkRegistered.Checked)
                {
                    lblError.Text = "";
                    EmailBE objEmailBE = new EmailBE();
                    EmailDA objEmailDA = new EmailDA();
                    //objEmailBE.isToEmailRef = true;
                    //objEmailBE.RequestStatus = "Queued";
                    //objEmailBE.RequestType = "Webinar Registrant Emailing";
                    //objEmailBE.Subject = txtSubject.Text;
                    //objEmailBE.SubmittedBy = Convert.ToInt32(Session["UserID"]);
                    //if (txtSendMeEmailAddress.Text != "")
                    //    objEmailBE.ToEmail = txtSendMeEmailAddress.Text;
                    //objEmailBE.FromEmail = Session["EmailID"].ToString();
                    //objEmailBE.EmailContent = redEmailRegistrants.Content;
                    //int requestID = objEmailDA.SaveEmailRequest(objEmailBE);

                    int requestID = SaveEmail("Webinar Registrant Emailing", txtSubject.Text.Trim(), txtSendMeEmailAddress.Text.Trim(), redEmailRegistrants.Content);
                    if (requestID != 0)
                    {
                        List<EmailAddressBO> objEmailAddress = new List<EmailAddressBO>();
                        if (chkDidNotAttend.Checked)
                        {
                            objEmailAddress = objEmailDA.GetToEmailAddress(Convert.ToInt32(hWebinarID.Value), "NOTATTENDED");
                            UpdateToEmails(objEmailAddress, "Email Registrant - NotAttended", requestID);
                        }
                        if (chkAttended.Checked)
                        {
                            objEmailAddress = objEmailDA.GetToEmailAddress(Convert.ToInt32(hWebinarID.Value), "ATTENDED");
                            UpdateToEmails(objEmailAddress, "Email Registrant - Attended", requestID);
                        }
                        if (chkAttendedLive.Checked)
                        {
                            objEmailAddress = objEmailDA.GetToEmailAddress(Convert.ToInt32(hWebinarID.Value), "LIVE");
                            UpdateToEmails(objEmailAddress, "Email Registrant - Attended Live", requestID);
                        }
                        if (chkOnDemand.Checked)
                        {
                            objEmailAddress = objEmailDA.GetToEmailAddress(Convert.ToInt32(hWebinarID.Value), "ONDEMAND");
                            UpdateToEmails(objEmailAddress, "Email Registrant - Attended Ondemand", requestID);
                        }
                        if (chkRegistered.Checked)
                        {
                            objEmailAddress = objEmailDA.GetToEmailAddress(Convert.ToInt32(hWebinarID.Value), "REGISTERED");
                            UpdateToEmails(objEmailAddress, "Email Registrant - All registered", requestID);
                        }

                        lblError.Text = "Successfully emailed to selected registrant group";
                        lblError.CssClass = "msgSuccess";
                    }
                }
                else
                {
                    lblError.Text = "At least one registration group has to be selected";
                }
            }
        }