In this episode, we dive into sending out the referral payout email to an admin. We start by creating a new mail class specifically for the referral payouts, keeping things simple for now. You’ll see how to set up the subject and basic body content, and we quickly scaffold a view for the email (kept minimal for now).
Next, we get our local email testing environment up and running using Mailpit. If you’ve never used Mailpit, you’ll see how easy it is to install and configure it so all outgoing emails from our Laravel app can be viewed right in the browser.
We hook up the admin recipient to our referral config so that it’s easy to update in the future without digging through code. Then we send out a test email using our payout endpoint, and sure enough, it shows up in Mailpit!
We don’t handle CSV attachments yet—that’s coming up in the next episode. For now, this episode is all about laying the groundwork for referral payout emails and making sure we can test them locally.