Ejemplo n.º 1
0
        private void SendLowInventoryNotificationEmail(MerchandiseProduct product)
        {
            using (MTCDbContext db = new MTCDbContext())
            {
                var emailBody = EmailManager.BuildMerchandiseProductLowInventoryEmailBody(product);
                var subject   = product.DisplayName + " Low Inventory Notification";

                MTCEmailRecipient mtcRecipient = new MTCEmailRecipient
                {
                    Email = Utilities.GetApplicationSettingValue("MerchandiseOrderFormRecipient"),
                    Name  = Utilities.GetApplicationSettingValue("MerchandiseOrderFormRecipientName")
                };

                List <MTCEmailRecipient> mtcRecipients = new List <MTCEmailRecipient> {
                    mtcRecipient
                };

                EmailManager.SendEmail(mtcRecipients, subject, emailBody, null);
            }
        }