Exemple #1
0
        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;
            }
        }
Exemple #2
0
        public async Task <int> CreateUser(UserModel model)
        {
            await _sendGridService.SendMail(model.Name, model.Email);

            return(await _userRepository.CreateUser(model));
        }