我有一个这样定义的邮件程序:
class AdminMailer < ActionMailer::Base
default from: "site@myapp.com", to: Rails.application.config.admin_email
def notify
mail subject "We have a new uer
end
end
我需要使用 Precedence = "bulk" 添加一个默认标题。如果我添加headers["Precedence"] = "bulk"
到notify()方法中,这是可行的。但我希望这是所有方法的默认值。我试过了
default from: "site@itcentralstation.com", headers: {"Precedence" => "bulk"}
default from: "site@itcentralstation.com", "headers" => {"Precedence" => "bulk"}
两次我都收到错误:NoMethodError - {"Precedence"=>"bulk"}:Hash: 的未定义方法`编码':