From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Preview email in browser

Preview email in browser

All right, guys, so we have our email template. Now before we actually implement the actual email sending, I want to see what that looks like. And there's actually a CLI that we can use with React email that will run a server locally and we can actually preview our email on the browser. But we do have to add a bunch of sample data with all the order stuff. So basically, if we look at the orders table, we need to add all this, the ID, user ID, the shipping address, the payment result. We need to mock this data, the order items themselves. So what we're going to do is jump into the purchase receipt file. And I want to add this right above. We'll go, I guess, right above the date formatter. And we're going to take the purchase receipt email function, or component function, and add onto it Preview Props. And then we're going to set that to an object, and this is where we add our data. Now, I didn't realize at the time, but the scoping of the function isn't going to work, because it's an…

Contents