1

我有一个这样定义的邮件程序:

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: 的未定义方法`编码':

4

1 回答 1

2

你有没有尝试过

default from: "site@itcentralstation.com", "Precedence" => "bulk"
于 2013-10-15T13:26:30.563 回答