public void InvitePlayer(string email, string teamId) { var subject = $"You have been invited to team {teamId} on NT League"; var tokenUrl = _inviteService.GenerateTokenUrl(teamId); var bodyMessage = $"To accept the invite from {teamId} enter the link : {tokenUrl}"; _inviteService.Invite(email, bodyMessage, subject); }
public StatusCodeResult Index(string email) { try { _inviteService.Invite(email); return(Ok()); } catch (McUserNotFoundException) { return(BadRequest()); } }
public async Task <IActionResult> Add([FromBody] InviteRequest inviteRequest) { if (!ModelState.IsValid) { return(BadRequest()); } Result result = await _inviteService.Invite(inviteRequest); if (result.Failure) { ModelState.AddErrors(result); return(BadRequest(ModelState)); } return(Ok(new EmptyResult())); }