Пример #1
0
        public async Task <IActionResult> Invite(string email)
        {
            if (!EmailBusinessRule.Validate(email))
            {
                return(Json(new { Status = false, Message = "Invalid email address." }));
            }

            Guid.TryParse(CurrentUser.NameIdentifier, out Guid userId);

            if (!await ReferralService.SendInvite(email, userId))
            {
                return(Json(new { Status = false, Message = "Error sending email. Try again later." }));
            }

            return(Json(new { Status = true }));
        }