class UserMailer < ApplicationMailer
default from: "[email protected]"
def account_activation(user)
@user = user
mail to: user.email, subject: "账户激活"
end
def password_reset
@greeting = "Hi"
mail to: "[email protected]"
end
end
在控制器里使用的时候都是直接用 UserMailer.account_activation(user), 不明白 account_activation 为什么变成了类方法