虽然我没有找到任何关于此的资源,但我会留下我收集的测试此功能的内容,以供其他可能发现此问题的人使用。
发送电子邮件的顺序(即 Destinations 属性中电子邮件的顺序)是返回的 messageId 的顺序。
因此,使用 docs json 示例:
{
"Source":"Mary Major <mary.major@example.com>",
"Template":"MyTemplate",
"ConfigurationSetName": "ConfigSet",
"Destinations":[
{
"Destination":{
"ToAddresses":[
"anaya.iyengar@example.com"
]
},
"ReplacementTemplateData":"{ \"name\":\"Anaya\", \"favoriteanimal\":\"angelfish\" }"
},
{
"Destination":{
"ToAddresses":[
"liu.jie@example.com"
]
},
"ReplacementTemplateData":"{ \"name\":\"Liu\", \"favoriteanimal\":\"lion\" }"
},
{
"Destination":{
"ToAddresses":[
"shirley.rodriguez@example.com"
]
},
"ReplacementTemplateData":"{ \"name\":\"Shirley\", \"favoriteanimal\":\"shark\" }"
},
{
"Destination":{
"ToAddresses":[
"richard.roe@example.com"
]
},
"ReplacementTemplateData":"{}"
}
],
"DefaultTemplateData":"{ \"name\":\"friend\", \"favoriteanimal\":\"unknown\" }"
}
发送的对象将是
(SendBulkTemplatedEmailRequest) request
具有以下列表的 a:
request.Destinations[0].ToAddresses = {"anaya.iyengar@example.com"}
request.Destinations[1].ToAddresses = {"liu.jie@example.com"}
request.Destinations[2].ToAddresses = {"shirley.rodriguez@example.com"}
request.Destinations[3].ToAddresses = {"richard.roe@example.com"}
并且(SendBulkTemplatedEmailResponse) response
会有这个列表:
response.Status[0].MessageId = "0000000000000000-11111111-2222-3333-4444-111111111111-000000"
response.Status[1].MessageId = "0000000000000000-11111111-2222-3333-4444-222222222222-000000"
response.Status[2].MessageId = "0000000000000000-11111111-2222-3333-4444-333333333333-000000"
response.Status[3].MessageId = "0000000000000000-11111111-2222-3333-4444-444444444444-000000"
在哪里:
- MessageId
"0000000000000000-11111111-2222-3333-4444-111111111111-000000"
是指发送到的电子邮件anaya.iyengar@example.com
;
- MessageId
"0000000000000000-11111111-2222-3333-4444-222222222222-000000"
是指发送到的电子邮件"liu.jie@example.com"
;
等等。