Sendgrid:如何使用webhook在C#中获取通知邮件? [英] Sendgrid: how to use webhook for to get notification email in C#?

查看:217
本文介绍了Sendgrid:如何使用webhook在C#中获取通知邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手在sendgrid中使用webhook,任何人都可以帮助我获取电子邮件通知状态,例如反弹,点击,处理等,我已经从sendgrid通知设置创建通知网址。但是当我发送邮件然后邮件已经发送但是不要打电话给我已经设置为电子邮件通知设置的api。请问有什么人可以帮我吗?

如果你给我一个例子会很好。

提前致谢



我尝试了什么:



我尝试过sendgrid事件通知的电子邮件设置并在那里设置我的api url。然后我做了一些活动,如发送电子邮件,打开电子邮件等等......从电子邮件通知中获取回电,但什么也没发生。如果有人帮助我,那就太棒了。

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.

推荐答案

//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;
        }


你有没有解决你的问题?

你能在这里发布你的完整代码(在C#中捕获sendgrid事件通知),我需要尽快实现。
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.


这篇关于Sendgrid:如何使用webhook在C#中获取通知邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆