'Sendgrid doesn't trigger webhook when email is sent
I'm using Sendgrid in an ASP.NET WEB API project, and I'm testing the webhook call with ngrok.
I first followed this guide: https://docs.sendgrid.com/for-developers/tracking-events/getting-started-event-webhook
Therefore i turned on Event Webhook and tested it with their integration test.
The problem is that it works only during test, if I send an email with my software, webhook is not fired. ( I receive the email, but Ngrok doesn't record a request)
This is how i send the email:
var client = new SendGridClient(Config.sendGridApiKey);
var x = MailHelper.CreateSingleEmail( new EmailAddress(Config.mymail),
new EmailAddress(to), content, content, content);
return await client.SendEmailAsync(x).ConfigureAwait(false);
Solution 1:[1]
I didn't choose the event triggering the webhook from the panel.
Now it works!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dragonthoughts |