【问题标题】:Redirect SendGrid Webhook Events with an F5 using Custom Headers使用自定义标头通过 F5 重定向 SendGrid Webhook 事件
【发布时间】:2021-10-29 13:32:11
【问题描述】:

通过 SendGrid 发送电子邮件时,我正在发送自定义标题。有没有办法配置 webhook 以从 SendGrid 获取自定义标头,以便可以轻松编写 F5 iRule 以根据此自定义标头中的值重定向流量。我知道我可以使用 .addCustomArgs(...) 返回自定义数据,但我想要标题中的自定义数据。

var client = new SendGridClient("API_KEY");
var from = new EmailAddress("test@example.com", "Example User");
var subject = "Testing with SendGrid API";
var to = new EmailAddress("joe@test.com", "Example User");
var plainTextContent = "Test Content";
var htmlContent = "<strong>Testing with HTML content</strong>";
var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);
var identifiers = new Dictionary<String, String>();
identifiers["application"] = "APP_NAME_GOES_HERE";
identifiers["resource"] = "RESOURCE_NAME_GOES_HERE";    
msg.AddHeaders(identifiers);   
var response = await client.SendEmailAsync(msg);

【问题讨论】:

    标签: sendgrid f5


    【解决方案1】:

    这里是 Twilio SendGrid 开发人员宣传员。

    恐怕您无法为 SendGrid 事件 webhook 设置标头以发回。自定义参数作为 JSON 正文的一部分发送。

    我以前没有使用过 F5 iRules,但您似乎可以在 iRule 中解析和使用请求的 JSON 正文。根据this post, you can use iRules LX to deal with the JSON using JavaScript.

    或者,您似乎可以将HTTP::collectHTTP_REQUEST_DATA block 结合起来收集并处理请求正文。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-27
      • 1970-01-01
      • 2023-04-05
      • 2013-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多