Esempio n. 1
0
        public void SendNewDepartmentLinkMail(DepartmentLink link)
        {
            var sourceDepartment = _departmentsService.GetDepartmentById(link.DepartmentId);
            var targetDepartment = _departmentsService.GetDepartmentById(link.DepartmentLinkId);
            var managingProfile  = _userProfileService.GetProfileByUserId(targetDepartment.ManagingUserId);

            _emailProvider.SendNewDepartmentLinkMail(managingProfile.FullName.AsFirstNameLastName, sourceDepartment.Name, "", managingProfile.User.Email, targetDepartment.DepartmentId);
        }
Esempio n. 2
0
        public async Task <bool> SendNewDepartmentLinkMailAsync(DepartmentLink link)
        {
            var sourceDepartment = await _departmentsService.GetDepartmentByIdAsync(link.DepartmentId);

            var targetDepartment = await _departmentsService.GetDepartmentByIdAsync(link.DepartmentLinkId);

            var managingProfile = await _userProfileService.GetProfileByUserIdAsync(targetDepartment.ManagingUserId);

            await _emailProvider.SendNewDepartmentLinkMail(managingProfile.FullName.AsFirstNameLastName, sourceDepartment.Name, "", managingProfile.User.Email, targetDepartment.DepartmentId);

            return(false);
        }