Ejemplo n.º 1
0
        public void MailNotAssignable(OnlineOrder order, string bdsEmail, string reason, string[] cc)
        {
            #region check
            if (order == null)
            {
                throw new ArgumentNullException(nameof(order));
            }

            if (string.IsNullOrEmpty(bdsEmail))
            {
                throw new ArgumentException("message", nameof(bdsEmail));
            }
            #endregion
            _composer.Reset();
            _composer.AppendText("p", $"Cant assign case from: {order.Name} CMND: {order.NatId}");
            _composer.AppendText("p", "Please assign manually.");
            if (!string.IsNullOrEmpty(reason))
            {
                _composer.AppendText("p", reason);
            }
            var mail = new MailMessage()
            {
                From       = CreateMailAddress(_options.Username),
                IsBodyHtml = true,
                Body       = _composer.ToString(),
                Subject    = "Can not assign online sale case"
            };
            //Always CC
            AddOptionsCC(mail);
            //Additional CC
            AddCC(mail, cc);

            mail.To.Add(CreateMailAddress(bdsEmail));
            _queue.Enqueue(mail);
        }
Ejemplo n.º 2
0
        public void MailCancelBet(Register bet)
        {
            _composer.AppendText("p", $"Cancel bet: <b>{bet.Username}</b>");
            _composer.AppendText("p", $"<b>{bet.Game.Player1} vs {bet.Game.Player2}</b> - {bet.Game.Start.ToString("dd-MM-yyyy hh:mm")}");
            _composer.AppendText("br", string.Empty);
            _composer.AppendText("p", $"Bet more at: {_options.Ad}");
            _composer.AppendText("p", "Thanks for playing :D");

            var mail = new MailMessage()
            {
                From       = CreateMailAddress(_options.Username),
                IsBodyHtml = true,
                Body       = _composer.ToString(),
                Subject    = "Bet canceled"
            };

            //Add receivers
            foreach (var address in _options.Receivers.Select(r => CreateMailAddress(r)))
            {
                mail.To.Add(address);
            }
            //CC bet owner
            mail.CC.Add(CreateMailAddress(bet.Username));
            _queue.Enqueue(mail);
        }