Exemplo n.º 1
0
        public void SendPaymentRecieptEmail(Payment payment, Department department)
        {
            IdentityUser user;

            if (department.ManagingUser != null)
            {
                user = department.ManagingUser;
            }
            else
            {
                user = _usersService.GetUserById(department.ManagingUserId);
            }

            var userProfile = _userProfileService.GetProfileByUserId(department.ManagingUserId);

            _emailProvider.SendPaymentReciept(department.Name, userProfile.FullName.AsFirstNameLastName, payment.PurchaseOn.ToShortDateString() + " (UTC)", payment.Amount.ToString("C"), user.Email,
                                              ((PaymentMethods)payment.Method).ToString(), payment.TransactionId, payment.Plan.Name, string.Format("{0} to {1}", payment.EffectiveOn.ToShortDateString(),
                                                                                                                                                   payment.EndingOn.ToShortDateString()), payment.EndingOn.ToShortDateString() + " " + payment.EndingOn.ToShortTimeString() + " (UTC)", payment.PaymentId);
        }