我有一个使用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。我如何强制返回其他价值?