(Rails3.2.11, ruby1.9.3)
app/models/user.rb
class User < ActiveRecord::Base : def confirm! super if confirmed? UserMailer.completion_of_registration(self).deliver end end
app/mailers/user_mailer.rb
class UserMailer < ActionMailer::Base def completion_of_registration(user) @user = user mail(:subject => "登録完了のお知らせ" , to: user.email) end end
app/views/user_mailer/completion_of_registration.text.erb
本文いれる