Пример #1
0
        public async Task <ResponseModel> Post(SignupModel model)
        {
            var context = new VirtualtraineesEntities();
            IAuthenticationService authenticationService = new AuthenticationManager(context);
            ResponseModel          response = authenticationService.Signup(model);

            if (response.IsSuccess)
            {
                var     emailer = new SendGridEmailer();
                Message message = EmailFactory.CreateMessage(new List <string>()
                {
                    model.Name
                },
                                                             new List <string>()
                {
                    model.Email
                }, EmailType.Welcome);
                var sent = await emailer.SendEmailAsync(message, new NetworkCredential("foyzulkarim", "Foysal.karim25"));
            }
            return(response);
        }