Resque mailer systemSTackerror to deep

时间:2015-09-23 13:26:39

标签: ruby-on-rails resque mandrill

我正在尝试在NotificationMailer上使用Resque :: Mailer

class NotificationsMailer < MandrillMailer::TemplateMailer
include Resque::Mailer

default from: 'myemail@gmail.com', from_name: 'Alex'

def create_client to
  mandrill_mail template: 'beta-sign-up-confirmation',
              subject: 'create a client',
              to: to,
              inline_css: true
end
end

当我致电

NotificationsMailer.create_client('myemail@gmail.com').deliver

我收到以下错误

SystemStackError: stack level too deep
from /Users/myname/.rvm/src/rvm/gems/ruby-2.2.2/gems/resque_mailer-2.2.7/lib/resque_mailer.rb:39:in  `method_missing'

1 个答案:

答案 0 :(得分:0)

我认为你不能这样做。 MandrillMailer::TemplateMailer不是ActionMailer::Base的子类,这是resque_mailer的要求。更准确地说,resque_mailer需要方法级兼容性,这是不符合的。