我有一个邮件定义如下:
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 - 未定义的方法`encoding'for {“Precedence”=&gt;“bulk”}:哈希:
答案 0 :(得分:2)
你试过吗
default from: "site@itcentralstation.com", "Precedence" => "bulk"