# Order confirmation emails

We built a small webshop, and over this series we're wiring Bird into it one channel at a time — with our coding agent doing the heavy lifting. In part one the shop learns to send order confirmation emails: one API key, one prompt to the agent, one function in the codebase, and every order lands a confirmation in the customer's inbox.

Video: https://www.youtube.com/watch?v=ugwFP5VU3EQ (7:42)

## What we cover

- Triggering an order confirmation from your backend
- Building the template once and reusing it per order
- Where this fits before parts two and three

## Transcript

_Auto-generated from the video._

Hey. Welcome to this whole new series. In this multi-part series, I'm going to show you how to integrate Bird into a functional integration. Um before we start, two things are already set up from our earlier videos. We have our coding agent all connected to Bird. There's a whole video about that. And we've already registered our sending domain, and it's all verified.

Um there are getting started videos for both, and I'll link those down in the comments. Um so the only thing that we're going to need today is actually an API key. So we're going to move into our Bird account. I'm going to navigate over to API keys. So here we can see the onboarding key that we already used from our onboarding cycle. We're just going to go and create a new key, and this is going to be for Bird shop. And it's going to be specifically for our emails. So we want it to be able to read and write emails. Uh we need to be able to do email management, set up domains. Well, we don't need mailboxes. So these should be more than sufficient.

So I'm going to create it. Copy. I've saved my key. Now I'm going to go into uh Cursor, where I've created it an env file. There we go. Just to make sure that it's stored and not going to go public. All right. Now that we've got the API key stored, it's actually the creation of the integration. Now for this, I'm not actually going to write anything myself. So I'm going to open up a new fresh Claude session. Um we're going to keep working on our uh web shop. We need to start integrating email. Have a look. That's the Bird CLI that we see what is needed.

Now, while it's already doing its research, um we're just quickly going to go back into uh Bird. And what I've already done in the meantime is that I've used my agent to create a few email templates um for the new bird shop. Uh there's a different video on how to create email templates using your agents. We've got an order confirmation. We've got the order shipment. Delivery states. Um welcome email. And we've got a re-engaged email. So, we've got some marketing and we've got some transactional emails that we're going to be integrating.

So, going back to our agents, we can see that it has done its research. It can see that the templates are already set up. So, it already found the templates without me even instructing it about that. Um so, we've got indeed the order confirmation, welcome email.

Um so, to send via CLI it's one command. So, now we have actually he's still running a task to explore the checkout flow. So, the agent kicked off just 50 seconds ago. So, we're just going to wait for it to complete that. Um to have it integrated. And I'll be right back. All right. So, the agent came back and it's full research. So, once ready, sending domain, Aviary Shop is fully verified. We've got five templates ready that we can start using. And then we've got the env ready with the API key as a placeholder. So, I have and actually save that. So, let me just So, save that up as well.

Um So, it's completely ready. There's no API routes. So, to send the email, we need a new API route. That's need to set up. We need to do wiring and the wiring registration. And the order confirmation template expects these parameters, all of which are already available. So, let's go build it.

And I'll I'll back once it's completed. All right, and it came back and it's completely done. So, what it did is it basically created the API routes for me, the checkout integration, and the registration integration. So, after successful registration, it will also send a welcome email.

Um so, we've got to place order now. Um so, now we actually Let's go place an order and see it coming in. I'm going to go for a single bird. Do the checkout. Whoop. And then we place our order. And then right on the dot the email came in.

I've got our order confirmation with our order number and a total. There's a track your order. Seems that this doesn't work. So, let's also update the template immediately to make sure that the track your order is working. I'm just going to get rid of this one and go back to our agent.

So, that we As it's proceeding, I'll see you once it's done. All right. So, it just completed its research, so it actually found out that the template itself wasn't the issue, but the way that it had linked it up. Um so, it's actually made those changes and it's currently running a test to see if the new links link emails work. So, I'll get actually get that in a few seconds. Uh now also go and wire up the rest of the templates to the order flow.

And to have an end-to-end work. All right. So, now it's actually completed everything and it's going to be uh testing it end-to-end. We can actually test this ourselves as well. So, I'm just going to go advance to next step. And and into shipped.

And there we go. Shipment was indeed integrated. So, here your order has shipped. Track delivery. And there we go. Out for delivery. And then also delivered. And there we go. There is the email delivered. And it's all wired up end-to-end. So, this was just a quick demo um tutorial.

Of course, in a real life environment, there might be a lot of different emails, different templates, different versions that's going to be working on. Um this was just to showcase the ease of it working with your agent to start integrating it into your website.

Um on the next one, I'm going to integrate SMS. So, we're going to actually have some uh SMS confirmations going out and I'll uh see you in the next one.

## More Bird Integration series

- [SMS shipping notifications](/en-de/learn/series/integration-shipping-sms) — 7:37
- [Verify phone numbers at signup](/en-de/learn/series/verify-signup) — 7:36

## Resources

- [Documentation](/en-de/docs)
- [Learn more about Email](/en-de/products/email)
