Esempio n. 1
0
        protected void SendButton_Click(object sender, System.EventArgs e)
        {
            // SHOW THE PREVIEW
            if (Page.IsValid)
            {
                // GENERATE MESSAGE AND SEND MESSAGE
                MailMergeTemplate          mergeTemplate = GetMailMergeTemplate();
                IList <MailMergeRecipient> recipients    = GetAllRecipients();
                mergeTemplate.Send(recipients, true);

                if (_RestockNotifyList != null)
                {
                    if (RemoveNotificationSubscriptionsFlag.Value == "1")
                    {
                        _RestockNotifyList.DeleteAll();
                    }
                    else
                    {
                        foreach (RestockNotify notification in _RestockNotifyList)
                        {
                            notification.LastSentDate = LocaleHelper.LocalNow;
                        }

                        _RestockNotifyList.Save();
                    }
                }

                // PROVIDE NOTIFICATION
                ComposePanel.Visible      = false;
                PreviewPanel.Visible      = false;
                ConfirmationPanel.Visible = true;
                SmtpErrorPanel.Visible    = false;
                ConfirmationMessage.Text  = string.Format(ConfirmationMessage.Text, recipients.Count);
            }
        }
Esempio n. 2
0
        protected void SendButton_Click(object sender, System.EventArgs e)
        {
            // SHOW THE PREVIEW
            if (Page.IsValid)
            {
                // GENERATE MESSAGE AND SEND MESSAGE
                MailMergeTemplate          mergeTemplate = GetMailMergeTemplate();
                IList <MailMergeRecipient> recipients    = GetAllRecipients();
                mergeTemplate.Send(recipients, true);
                if (_EmailList != null)
                {
                    _EmailList.LastSendDate = LocaleHelper.LocalNow;
                    _EmailList.Save();
                }

                // PROVIDE NOTIFICATION
                ComposePanel.Visible       = false;
                PreviewPanel.Visible       = false;
                ConfirmationPanel.Visible  = true;
                SmtpErrorPanel.Visible     = false;
                ConfirmationMessage.Text   = string.Format(ConfirmationMessage.Text, recipients.Count);
                Session["SendMail_IdList"] = null;
            }
        }