Ejemplo n.º 1
0
        public void SendPaymentInvoiceEmail(string paymentId, string companyEmail, string companyName)
        {
            var payment = _repository.AsNoTracking().SingleOrDefault(x => x.Id == paymentId);

            string subject = $"DataCrud just receive a payment from {companyName}";
            string body    = $"Dear {companyName}, <br/>" +
                             $"We have received a BDT{payment.PaidAmount.ToRound2Decimal()} amount of payment from {companyName} on {payment.Date: dd/MM/yyyy HH:mm} by {payment.PaymentMethod.GetDescription()} <br/><br/>" +
                             $"Your payment reference number is <strong>{payment.Id}.</strong> For any further query please use the last 6 digit of this reference number. <br/><br/>" +
                             $"Your payment is waiting for confirmation. This will take 24-48 hours maximum. Our sales team will contact you shortly or you can contact us directory at {SmsHelper.GetSupportNo()} to complete the verification process early to activate your account. We are sorry for waiting for you for payment confirmation.<br/></br/>" +
                             $"Thanks for your patience and having with us." +
                             $"{EmailHelper.Signature.Sales}";

            //Attach an invoice with this email

            var task = Task.Run(async() => await _emailSender.SendSecurityEmailAsync(companyEmail, companyName, subject, body));

            task.Wait();
        }