class AdminMailer < ActionMailer::Base
def send_message_to_user(user, subject, body, locale)
@body = body
mail(:to => user.email, :subject => subject)
end
def send_message_to_all_users(user, subject, body, locale)
@body = body
mail(:to => user.email, :subject => subject)
end
def send_message_to_active_users(user, subject, body, locale)
@body = body
mail(:to => user.email, :subject => subject)
end
def send_message_to_suspended_users(user, subject, body, locale)
@body = body
mail(:to => user.email, :subject => subject)
end
end
我想为每个操作使用 4 个视图send_message_to_active_users.html.erb
, send_message_to_all_users.html.erb
, send_message_to_suspended_users.html.erb
, send_message_to_user.html.erb
,我只想对所有操作使用 1 个视图文件。
我该怎么做?
谢谢!