Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am new to use webhook in sendgrid,can any one help me to get email notification status e.g. bounce,click,processed and so on, i have create notification url from sendgrid notification settings. but when i send a mail then mail has been delivered but do not call my api which i have set to email notification setting. can any one help me please?
It would be nice if you give me an example.
Thanks in advance

What I have tried:

I have tried with the email settings on sendgrid event notification and set my api url there. then i had do some activity like send email, open email and so on... to get callback from email notification,but nothing happened. if any one help me then it would be so great.
Posted
Updated 7-Aug-17 19:26pm
Comments
j snooze 16-May-17 17:18pm    
have you tried calling your own api and simulating what sendgrid would be sending to see what you get back?
saumil jariwala 22-May-17 5:21am    
Yes i have tried it and i get only empty array,nothing else.
Thank you

C#
//I have used following method
//This is my api which i have put in Sendgrid > Mail Settings > Event Notification >

//http://username:pwd@beta.comivo.com/api/sendGrid/Webhook

<pre>[Route("Webhook")]
        [HttpPost]
        public void SendGrid([FromBody]SendGridSentEvent[] eventList)
        {
            try
            {

                if (eventList != null && eventList.Count() > 0)
                {
                    foreach (var eve in eventList)
                    {
                        SendgridWebhookModel sendGridEvent = new SendgridWebhookModel();
                        sendGridEvent.status = eve.status;
                        this.sendGridWebHookRepository.SaveWebhookDetail(sendGridEvent);
                    }
                }

            }
            catch (Exception ex)
            {
                //return jsonArray;
            }


            //return jsonArray;
        }
 
Share this answer
 
v2
Comments
Member 13350786 8-Aug-17 1:28am    
Did you resolve your issue?
Can you please post your complete code(capture sendgrid event notification in C#) here, I need to implement is asap.
Did you resolve your issue?
Can you please post your complete code(capture sendgrid event notification in C#) here, I need to implement is asap.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900