Hey there.
Everyone had their share.
Welcome to Another Theory video.
And in this video, we're going to take a little bit lightweight and we're going to talk about the images
and mail for the images part.
We have already created a dedicated section.
In case you haven't watched that.
Hey, please just follow the flow of this course.
This is very important for this course.
So we are already quite familiar with the cloud native format.
And it's not just about cloud entry.
You have a full understanding of how images are being transferred to one or other.
Now you can just throw images onto a WAC firebase whatever comes to your way.
So that is nice.
Another thing that we are going to work on is the node mailers, so obviously you'll be sending some
mail.
So it is very important for you to understand the mailing and I'll share some of the personal story,
a kind of a small incident video for the mail we are going to use all time favorite node mailer.
Yes, there are other services as well, but Node Mailer is all time hands down, one of my favorite.
So what you got to do for this node mailer obviously and beam install node mailer and after that, the
things are really easy and all you need to know is this example, not even entirely, just a few bits
and pieces of it, and that's pretty much it.
So what happens in the Node mailer once you have kind of a required the node mailer at the top, all
you got to do is inside this node mailer, you get two methods.
And yes, these two methods are only thing that you need to study here.
So the first thing is create transporter.
Now this is some guy just imagine you are creating a van which is going to deliver your mails.
So this mail is called as transporter.
That's all you got to do.
Now in this kind of a van, you need to fill up some of the information.
You can say that we need to fix some tires and put some gas into it and all of that.
So all you need to do is provide a host to it.
And this host information comes up from whatever your mail provider is.
It may be send in blue, it may be a W.
S, there are a whole lot of mail providers available.
Depends on which one is giving you the cheaper mail service.
You can go ahead and use that so you require a host port and these to information host port.
We majority the time we don't use the secure as false.
But you can actually go ahead and use the port for that.
And on top of that, you definitely give your account information which is in the auth section.
So you give your user and pass.
And these are usually kind of a token, not actually the password, but sometimes it can be password
as well.
So these are the basic information and that's it.
Now the good thing is this exact information is given to you by Send in Blue.
It is given to you by eight of Lewis's service and a whole bunch of other services as well.
And this is the most beautiful thing.
I'll tell you some information on that in a second.
So once the transporter is ready, you hold the reference of this created transporter into this transporter
variable or whatever you're calling that variable.
And after that, all you got to do is just use this variable and say, send mail.
Yeah, that's it, that's it.
That's all you say.
And in this, obviously you pass on some of the basic information like from which says where you want
to send it to from where it is coming in.
And then the subject obviously then the text or you can send some HTML part as well.
The reason why we send the text in HTML, you might have seen some of the information where you say,
hey, forgot your password or reset your password, and then it says, if the button is not working,
just copy paste this particular code into your URL.
And that's why exactly we send some of the text information as HTML.
Maybe it's HTML hasn't properly rendered in the button format.
So we might want to give the user the entire text so that he can copy it and paste it in the browser
at least can the job done.
So this is all this is all it takes.
Now, sharing a personal information.
Once I was working in a company and suddenly it was actually blocked over all of email, communication,
everything for some bizarre reason.
Now our founder actually got a little bit panicked that, hey, entirety of the email services done
what we need to do.
I said nothing much.
We just need a new email service.
We immediately signed up and within just 2 to 3 minutes I just changed this information into the environment
variables and that's it.
Everything was working fine.
Surely we paid a little bit extra to the service that we opted in right now because it was a big company
and they were having huge number of emails going on, but within 5 minutes we were all back up and running
and that's when I requested our founder that, Hey, can you please actually support a bit to the Node
Mailer project as well?
Can you send something to his PayPal account or something?
And he sent $100 to it that hey, this, I have sent $100 because it is it was recommended by you.
So I think there is something really important that saved us that day.
So, yes, Node Mailer is that good of a project that I recommended my senior to support him a little
bit.
So again, I tell you that this is one of the easiest way of handling the email.
Please don't panic out.
It's really the easiest thing just because you haven't handled it.
That's why it's a fear of unknown.
So that's all what we'll be doing?
Yes.
We'll be using Node Mailer and we'll be using cloud native for images cloud.
I haven't much deployed it in the production yet, but it has a great reputation.
You can use SES eight s buckets as well.
You can go ahead and use something else.
It's kind of one of the same.
That's it for this video.
Let's go ahead and catch up in the next one.