Custom Class Devise使用Mandrill Api发送电子邮件

时间:2015-08-19 21:26:16

标签: ruby-on-rails email devise actionmailer mandrill

我有一个使用Devise :: Mailer发送电子邮件的自定义类

class DeviseMailer < Devise::Mailer
  helper :application

  def reset_password_instructions(record, token, opts={})
    email = [{ email: record.email }]
    params = { from: { name: "Email", email: "noreply@email.com" }, subject: t('forgot_password_mail.subject'), to: email, render: { view: 'devise/mailer/reset_password_instructions', locals: { token: token, user: record.first_name }}}
    MandrillApi.new.send(params)
  end
end

尝试发送电子邮件时我需要验证返回值,但是当尝试从reset_password_instructions获取返回值时返回#<ActionMailer::Base::NullMail:0x007f821da53218>

我认为Devise :: Mailer使用ActionMailer。我如何强制返回其他价值?

0 个答案:

没有答案