public async Task Handle(EventMailQueue @event) { _logger.LogInformation($"RabbitMQ{@event.Title}"); SendGridData data = new SendGridData { Title = @event.Title, To = @event.To, Content = @event.Content, ToName = @event.To, SendGridAPIKey = _configuration["SendGrid:ApiKey"] }; var result = await _sendGridService.SendMail(data); if (result.IsSuccess) { await Task.CompletedTask; return; } }
public async Task <int> CreateUser(UserModel model) { await _sendGridService.SendMail(model.Name, model.Email); return(await _userRepository.CreateUser(model)); }