var d = new Dictionary<string, string>{{"var1", "global value 1"}}; var json = Json.Encode(d); Response.Write(json);
UPDATE following your latest comment:
You can provide as many additional headers as you like. The WebMail.Send method's additionalHeaders parameter accepts a List<string>
var myHeaders = new List<string> {"X-MC-MergeVars: {\"var1\": \"global value 1\"}"}; WebMail.Send(foo: foo, bar: bar, additionalHeaders: myHeaders);
var d = new Dictionary<string, string>{{"var1", "global value 1"}}; var json = Json.Encode(d); Response.Write(json);
更新以下你的最新评论:
你可以提供许多额外的标题为你喜欢的。邮件发送方法。additionalHeaders参数接受List<string>
var myHeaders = new List<string> {"X-MC-MergeVars: {\"var1\": \"global value 1\"}"}; WebMail.Send(foo: foo, bar: bar, additionalHeaders: myHeaders);