学习 / 邮件指南 / 一次 API 调用发送 100 封邮件

一次 API 调用发送 100 封邮件

2:36 分钟

批量发送是在单个请求中包含一组完整邮件发送的数组——每个条目都有自己的收件人、主题、内容和模板参数。在本视频中,我们发送一个故意包含错误的批量请求,看 Bird 在任何内容进入队列之前拒绝整个请求,然后修改一行代码,为每条消息获得一个 ID。

内容概览

  • 单次 API 调用最多发送 1,000 封邮件
  • 为批量发送中的每条消息进行个性化
  • 查看每个收件人的发送结果
Transcript

Auto-generated from the video.

Hey, and welcome to another video. Um, today I'm going to be talking about batch sending. Um, so the difference between broadcast, which we covered in a different video, and batch sending is a broadcast is a predefined group email that you're going to be sending to a lot of recipients at the same time. Whereas a batch send basically allows you to send a pile of emails that you've already had to just be submitted through a single API call. So these are usually group uh a bunch of emails that you've already set up. These can be notifications, they can be OTP verification emails, they can be marketing emails, that doesn't matter cuz these are all individual sends with their own uh sender, their own recipient, their own subject, and their own template.

Um, so what I've got here is just a documentation, again, bird.com/docs. All of our documentation is updated on a uh on a regular basis, enabling you to always have the full overview. Um, when we scroll down to batch sends, here we can actually see that there's nothing more than just batching your emails together. It's good to note that this can be done up to 100 emails within a single batch, and this allows you to lower the amount of API calls that you would need to make. So instead of sending an API call for every single email that needs to be sent out, you can actually batch them together in groups of 100 to make it more um more carriable for the system.

Um, so as you can see here, so the only thing that's different is that we actually give them a batch key and that we're calling uh the batch API, but then the actual individual email sections are all still the same. So they've all got their own from, their own to, their unique subject, the actual email, and the specific category for that send. Now, I've opened up my terminal and I've already had a batch send ready with specific files saved on my computer.

Sending it out, we can see that the batch has been successfully sent. Now, here you can see that the batch returns the data per individual email. So we've got the full data point per individual email that we have been sending. Now, if we go back into our email logs and we refresh for the latest, we can actually see that the batch has gone out, but they're all sent as individual messages. Um so, we can see the complete details of the specific email event.

Um again, there's no reference back to that batch because it's in the essence just an individual email just getting submitted in a batch towards our system. That is batch sending in a nutshell. Um go and have a look, play around with it. And we say happy sending.

从一个渠道开始。
准备好后,再添加其他渠道。

测试 API 密钥即刻可用。添加支付方式并验证发送者身份后,即可解锁生产环境。

正在使用 Claude Code、Cursor 或 Codex?复制一条设置提示,您的智能代理即可自动安装 Bird CLI 和相关技能。选择您的工具:

Cursor