public async Task SendEmail(SendgridData sendgridData)
        {
            //WTF with this approach??
            //using (var httpClient = new HttpClient() { })
            //{
            //    httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", sendGridSettings.ApiKey);

            //    await httpClient.PostAsJsonAsync(sendGridSettings.SendgridMailingApi, JsonConvert.SerializeObject(sendgridData))
            //              .ContinueWith((postTask) => postTask.Result.EnsureSuccessStatusCode());

            //}

            var data    = JsonConvert.SerializeObject(sendgridData);
            var client  = new RestClient(sendGridSettings.SendgridMailingApi);
            var request = new RestRequest(Method.POST);

            request.AddHeader("content-type", "application/json");
            request.AddHeader("authorization", $"Bearer {sendGridSettings.ApiKey}");
            request.AddParameter("application/json", JsonConvert.SerializeObject(sendgridData), ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        }
        public async Task SendEmail(EmailSendingRequest emailSendingRequest)
        {
            var sendgridData = new SendgridData()
            {
                Personalizations = new List <Personalization>()
                {
                    new Personalization
                    {
                        To = new List <To>()
                        {
                            new To {
                                Email = emailSendingRequest.Recipient.Email,
                                Name  = emailSendingRequest.Recipient.Name
                            }
                        },
                        Subject       = emailSendingRequest.EmailMessage.Subject,
                        Substitutions = emailSendingRequest.MergeFields
                    }
                },
                Content = new List <Content>()
                {
                    new Content {
                        Type = "text/html", Value = emailSendingRequest.EmailMessage.Body
                    }
                },
                From = new From
                {
                    Email = emailSendingRequest.Sender.Email,
                    Name  = emailSendingRequest.Sender.FromLabel
                },
                ReplyTo = new ReplyTo
                {
                    Email = emailSendingRequest.Sender.Email,
                    Name  = emailSendingRequest.Sender.FromLabel
                },
                TemplateId       = emailSendingRequest.TemplateId,
                TrackingSettings = new TrackingSettings()
                {
                    ClickTracking = new ClickTracking()
                    {
                        Enable = !emailSendingRequest.DisableClickTracking
                    },
                    OpenTracking = new OpenTracking()
                    {
                        Enable = !emailSendingRequest.DisableOpenTracking
                    }
                }
            };

            if (!string.IsNullOrEmpty(emailSendingRequest.TemplateId))
            {
                sendgridData.Content = null;
                sendgridData.Personalizations[0].Subject = string.Empty;

                await SendEmail(sendgridData);
            }
            else
            {
                await SendEmail(sendgridData);
            }
        }