0:00 All right. So to configure the environment variables 0:02 we need, we are gonna head 0:04 back into Mailtrap and open up our email sandbox. 0:08 And then if we scroll down here, we can actually see a 0:12 Node.js sample code on how to configure Nodmailer 0:16 with the environment variables all set up that we need. 0:21 So let's go ahead and copy over all of these environment 0:23 variables that we're 0:24 reading in into our .env at the root of the 0:28 project in its own section. 0:30 All right, so now I've added all the environment 0:32 variables over 0:34 that the adapter uses. And so now we're gonna fill these in 0:37 according to the 0:38 environment variables here, 0:40 according to the configuration that Mailtrap provides. 0:43 So for example, you can see the host here for our SMTP 0:46 server. 0:47 We'll simply just paste this over, which is the 0:49 sandbox.smtp.mailtrap.io, and then go ahead and 0:53 do the same thing for the port. Next up, copy the user 0:58 credentials here. And to get access to the password, 1:01 you can just 1:01 copy the entire code snippet, which will give you the 1:05 password. You can then paste that. 1:08 And then finally, the from is going to be, well, whatever we want. 1:12 I'll make this noreply@cleanshop.dev. 1:16 And now at this point, we have our environment variables fully 1:19 configured for the 1:20 SMTP server. This means the adapter is ready to use, which is great. 1:25 Let's make sure we now finally actually wire this in by heading back 1:29 into our customer module, where now we need to 1:32 swap out the notification service. Right now we're using the console. 1:37 For testing purposes, this is great. 1:38 And again, this is another amazing benefit of our 1:41 clean architecture, right? 1:42 Because in local development, we might not want 1:46 these same production dependencies like the email 1:50 adapter. Instead, we can use a local console adapter.
The rest of the transcript is for members.
Sign in