public void SendPaymentRejectionEmail(string subscriptionId, string companyEmail, string companyName) { var payment = _repository.GetAll().FirstOrDefault(x => x.SubscriptionId == subscriptionId && x.PaymentStatus == SubscriptionPaymentStatus.Rejected); if (payment != null) { string subject = $"Sorry, your payment has been rejected."; string body = $"Dear {companyName}, <br/>" + $"We had received a BDT{payment.PaidAmount.ToRound2Decimal()} amount of payment from {companyName} on {payment.Date: dd/MM/yyyy HH:mm} by {payment.PaymentMethod.GetDescription()}. But your payment failed to verify bearing reference number {payment.Id}. <br/><br/>"; if (payment.PaymentMethod == SubscriptionPaymentMethod.Bkash || payment.PaymentMethod == SubscriptionPaymentMethod.Rocket) { body += $"The trnasection numner <strong>{payment.TransectionNumber}</strong> doesnot match."; } body += $"For any further query please contact {SmsHelper.GetSupportNo()}.<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(); } }
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(); }