Пример #1
0
        public void SendCancellationEmail(Payment payment, Department department)
        {
            if (department == null && payment != null && payment.Department != null)
            {
                department = payment.Department;
            }

            if (department == null)
            {
                return;
            }

            var user    = _usersService.GetUserById(department.ManagingUserId);
            var profile = _userProfileService.GetProfileByUserId(user.UserId);

            if (user == null)
            {
                return;
            }

            string name = "";

            if (profile != null)
            {
                name = profile.FullName.AsFirstNameLastName;
            }

            _emailProvider.SendCancellationReciept(name, user.Email, payment.EndingOn.ToShortDateString(), department.Name);
        }