Beispiel #1
0
        private void ProcessEmailQueue()
        {
            MailQueueManager manager = new MailQueueManager();
            manager.Catalog = AppUsers.GetCurrentUserDB();

            ThreadPool.QueueUserWorkItem(async callback => { await manager.ProcessMailQueueAsync(); });
        }
        private void CreateEmail(long tranId)
        {
            string sendTo = Parties.GetEmailAddress(AppUsers.GetCurrentUserDB(), TranBook.Sales, SubTranBook.Delivery,
                tranId);

            if (string.IsNullOrWhiteSpace(sendTo))
            {
                return;
            }

            string message = ProcessEmailMessage(tranId);
            string attachment =
                HostingEnvironment.MapPath("/Resource/Documents/" + Titles.SalesDelivery + "-#" + tranId + ".pdf");

            string subject = string.Format(Labels.SalesDeliveryEmailSubject, tranId,
                AppUsers.GetCurrent().View.OfficeName);

            MailQueueManager queue = new MailQueueManager(AppUsers.GetCurrentUserDB(), message, attachment, sendTo,
                subject, tranId);
            queue.Add();
        }