Пример #1
0
        private async Task <ItemResponse <Guid> > SendNewConfirmationEmail(string firstName, string lastName, string email, string id)
        {
            SecurityTokenAddRequest securityToken = new SecurityTokenAddRequest();

            securityToken.FirstName    = firstName;
            securityToken.LastName     = lastName;
            securityToken.Email        = email;
            securityToken.TokenTypeId  = 1;
            securityToken.AspNetUserId = id;

            Guid emailSecurityToken = SecurityTokenService.Insert(securityToken);

            ConfirmationEmailRequest emailRequest = new ConfirmationEmailRequest();

            emailRequest.FirstName     = firstName;
            emailRequest.LastName      = lastName;
            emailRequest.Email         = email;
            emailRequest.SecurityToken = emailSecurityToken;
            //Removed static to enable DI
            await _emailService.ConfirmRegistration(emailRequest);

            ItemResponse <Guid> response = new ItemResponse <Guid>();

            response.Item = emailSecurityToken;
            return(response);
        }