To send emails confirmations in the application, we are using a gem called malone.

Sending a welcome email:

You can write in the file app.rb:

view changes

Create a folder with the name services:

In this folder we create a file with the extension .rb.

Here we define a class Mailer and we assign methods. When you use extend you add methods to the class and when you using include you add the methods to the instance.

Create a folder with the name mails:

In this folder we create a file with the extension .mote:
- forgot_password.mote
- welcome.mote

This files are only text, you have to write the content of the mail that the user will receive.

Sending a Forgot Password email:

How can I identify the name of the user?

We create a file with the name: helpers.rb

module Helpers
  def current_user
    authenticated(User)
  end
end

Instead of using authenticated(User), you can use current_user.

Now when we render, we can do this:

render("/profile", title: "Profile", current_user: current_user)

To find the user’s name in the profile.

params[:current_user].name