Пример #1
0
        public ActionResult Invite(Guid id, UserInviteViewModel model)
        {
            User user = this.userService.RetrieveUserById(id);

            var invitationLink = this.GetInvitationPage();
            var expiration = DateTime.UtcNow.AddDays(30);

            try
            {
                this.invitationService.InviteUser(user, invitationLink, expiration, model.PersonalMessage, false);
            }
            catch (System.Net.Mail.SmtpException e)
            {
                model.User = user;
                ModelState.AddModelError("SmtpError", e);

                return View("Invite", model);
            }

            return RedirectToAction("Details", new { id = user.UserId });
        }
Пример #2
0
        public ActionResult Invite(Guid id)
        {
            User user = this.userService.RetrieveUserById(id);

            var model = new UserInviteViewModel()
            {
                User = user
            };

            return View(model);
        }