コード例 #1
0
ファイル: OrderService.cs プロジェクト: rjinaga/oms-demo-work
        private void SendNotification(Order order, int orderId)
        {
            // This can be queued and send it by diffent service (communication service)
            TemplateResult templateResult = _emailTemplate.GetInvoiceEmailMessage(order, orderId);
            EmailMessage   emailMessage   = new EmailMessage
            {
                ToAddress = new string[] { order.Buyer.Email }
            };

            try
            {
                // TODO: async
                _email.Send(emailMessage);
            }
            catch (Exception)
            {
                // DONT RETHROW HERE
                // TODO: handle exception and log it, ensure retry/queue it for sending message
            }
        }