Lernen / E-Mail-Anleitungen

100 E-Mails in einem API-Aufruf senden

2:36 Min.

Ein Batch ist ein Array vollständiger E-Mail-Sends in einem einzelnen Request — jedes Element mit eigenem Empfänger, Betreff, Inhalt und Template-Parametern. In diesem Video senden wir einen Batch mit einem absichtlichen Fehler und beobachten, wie Bird das Ganze ablehnt, bevor irgendetwas in die Warteschlange gelangt. Dann korrigieren wir eine Zeile und erhalten für jede Nachricht eine ID zurück.

Was wir behandeln

  • Bis zu 1.000 E-Mails in einem einzigen API-Aufruf senden
  • Jede Nachricht im Batch personalisieren
  • Das Ergebnis pro Empfänger auslesen
Transkript

Automatisch aus dem Video generiert.

Vollständiges Transkript

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.

In die Praxis umsetzen.

Weiter mit der Dokumentation, Anleitungen und Beispielen zu diesem Thema. Die Ressourcen sind auf Englisch.

Implementierungs-Briefing erhalten

Ihre nächste Idee.
Bereit zur Verbindung.