我的 user_mailer.rb:
class UserMailer < ActionMailer::Base
default :from => "notifications@example.com"
def welcome_email(user)
@user = user
@url = "http://example.com/login"
mail(:to => user.email,:subject => "Welcome to My Awesome Site") do |format|
format.html
end
end
end
这就是我的 user_mailer.html.erb 的样子:
<!DOCTYPE html>
<html>
<body>
<%= yield %>
</body>
</html>
我可以在 user_mailer.html.erb 中访问什么。我需要在哪里定义环境变量以便我可以在这里访问它?