2

我们正在从 Mandrill 迁移到 SparkPost。我们认为 SparkPost 的传输最接近 Mandrill 的发送模板消息调用。

Mandrill 用每封电子邮件的idstatus列表来响应这些呼叫。另一方面,SparkPost 返回单个id和摘要统计信息(已发送的电子邮件数量和失败的电子邮件数量)。有没有办法让那些idstatus脱离传输响应或者根本没有?

4

3 回答 3

3

you can get the message IDs for messages sent using the tranmissions API two ways:

  • Query the message events API, which allows you to filter by recipients, template IDs, campaign IDs, and other values
  • Use webhooks - messages are sent to your endpoint in batches, and each object in the batch contains the message ID

Which method you choose really depends on your use case. It's essentially poll (message events) vs. push (webhooks). There is no way to get the IDs when you send the transmission because they are sent asynchronously.

于 2016-04-12T13:11:42.947 回答
1

查询消息事件 API 虽然是一个可行的选择,但会使我们的简单解决方案不必要地复杂化。另一方面,我们非常想使用 Webhooks,但不知道它们与哪个消息相关会很麻烦......

缺少的链接是将我们自己的 id 放在rcpt_meta中。我们关心的大多数 webhook 都包含rcpt_meta,因此我们可以用它替换message_id

于 2016-04-12T14:24:17.407 回答
0

我也被这个问题困扰了。如果替换对 rcpt_meta 有效,那么使用 rcpt_meta 解决方案将是完美的,但事实并非如此。

因此,在发送活动的情况下,我不能内联指定所有收件人,但必须为每条消息进行一次 API 调用,这对 - 比如说 - 10/100k 的收件人来说是不利的!但是现在,每个 SINGLE 收件人的所有传输 ID 都是唯一的,所以我缺少密钥,不再需要 rcpt_meta。

因此接收 webhook 时要使用的密钥组成:

transmission_id **AND** rcpt_to
于 2016-04-14T10:13:28.683 回答