clarkngo / curriculum

0 stars 0 forks source link

As a user, I will receive a confirmation e-mail. #20

Open clarkngo opened 5 years ago

clarkngo commented 5 years ago
clarkngo commented 5 years ago

Do i need to follow this documentation (https://edgeguides.rubyonrails.org/action_mailer_basics.html and) create the mailer first (rails generate mailer UserMailer)?

conradwt commented 5 years ago

No, I recommend using the link here because edgeguides refers to Rails 6 beta at this time. Next, you're correct that you can use rails generate mailer UserMailer. However, you shouldn't be writing mailer specs. They should be removed if these files are generated.

clarkngo commented 5 years ago

rails generate mailer UserMaileroutputs:

create  app/mailers/user_mailer.rb
create  app/mailers/application_mailer.rb
invoke  erb
create    app/views/user_mailer
create    app/views/layouts/mailer.text.erb
create    app/views/layouts/mailer.html.erb
invoke  test_unit
create    test/mailers/user_mailer_test.rb
create    test/mailers/previews/user_mailer_preview.rb

I should remove the following files?

test/mailers/user_mailer_test.rb
test/mailers/previews/user_mailer_preview.rb
conradwt commented 5 years ago

@clarkngo There's no need to create a UserMailer here because this functionality exists within Devise. Thus, I recommend that you review Devise docs.