...

/

Send an Order Confirmation Email

Send an Order Confirmation Email

This lesson explains how to send a confirmation email to the user who places an order.

We will create a mailer model to send a confirmation email to the user who places an order. This model will allow us to send data through email protocols. If you want to skip this lesson and jump into the next chapter, go ahead. This section is more of a warm-up.

Generate mailer

We must first create the order_mailer with an email named send_confirmation by using the command in the terminal below:

$ rails generate mailer order_mailer send_confirmation
Terminal 1
Terminal
Loading...

The output will look something like this:

Running via Spring preloader in process 29
      create  app/mailers/order_mailer.rb
      invoke  erb
      create   
...