Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/334.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SendGrid AddSubstitution()每次都不工作(C#)_C#_Asp.net_Sendgrid - Fatal编程技术网

SendGrid AddSubstitution()每次都不工作(C#)

SendGrid AddSubstitution()每次都不工作(C#),c#,asp.net,sendgrid,C#,Asp.net,Sendgrid,我有一条SendGrid消息,我正在开发环境中构建和测试它。它指向我在SendGrid仪表板中创建的模板,并填充电子邮件正文中的一些模板字符串,如下所示: message.AddSubstitution("{Event__Acdy_For___Location1}", new List<string> { e.Location }); message.AddSubstitution("{Event__Acdy_For___Address1}", new List<string&

我有一条SendGrid消息,我正在开发环境中构建和测试它。它指向我在SendGrid仪表板中创建的模板,并填充电子邮件正文中的一些模板字符串,如下所示:

message.AddSubstitution("{Event__Acdy_For___Location1}", new List<string> { e.Location });
message.AddSubstitution("{Event__Acdy_For___Address1}", new List<string> { e.Address });
message.AddSubstitution("{Event__Acdy_For___City1}", new List<string> { e.City });
message.AddSubstitution("{Event__Acdy_For___State1}", new List<string> { e.State });
message.AddSubstitution("{Event__Acdy_For___Zip1}", new List<string> { e.Zipcode });
message.AddSubstitution(“{Event\uuuuuu Acdy\u代表位置1}”,新列表{e.Location});
message.AddSubstitution(“{Event_uuuuuacdy_For_uuuuuuaddress1}”,新列表{e.Address});
message.AddSubstitution(“{Event_uuuacdy_代表城市1}”,新列表{e.City});
message.AddSubstitution(“{Event_uuuuacdy_For_uuuuuustate1}”,新列表{e.State});
message.AddSubstitution(“{Event_uuacdy_For_uuuzip1}”,新列表{e.Zipcode});
如果我每隔一分钟左右发送一次,我会注意到一些电子邮件在这些替换点中有空字符串,在这些替换点中,相同的电子邮件(从我这边经过相同的构造)显示一切都很好

如果我快速发射这些,它是完全命中或未命中;每次发送我都会收到一封电子邮件,但实际上只有几个人填写了替换内容


以前有人见过这个吗?我在我的终端或SendGrid的仪表板上没有看到任何错误。

也有同样的问题。您是否能够找出这是由api中的错误引起的。您使用的是什么?检查您的有效负载-哪些内容已发送到api。我怀疑在个性化阵列中,您有2封电子邮件要发送。有相同的问题。您是否能够找出这是由api中的错误引起的。您使用的是什么?检查您的有效负载-哪些内容已发送到api。我怀疑在个性化阵列中,您有2封电子邮件要发送。