2014-09-10 1 views
1

Я настроил notification_mailer.rb в папке моих почтовых программ, чтобы использовать API Mandrill, но почтовый ящик игнорирует его и продолжает использовать обычный метод smtp. Я сделал то же самое с Devise, но Devise имеет config.mailer в своем файле инициализации. Не почтовый ящик.как переопределить почтовый ящик почтового ящика

Ниже представлен файл почтовой рассылки. Спасибо за указатели.

class Mailboxer::NotificationMailer < Mailboxer::BaseMailer 
#Sends and email for indicating a new notification to a receiver. 
#It calls new_notification_email. 

def mandrill_client 
    require 'mandrill' 
    @mandrill_client ||= Mandrill::API.new ENV['MANDRILL_APIKEY'] 
end 


def send_email(notification, receiver) 
    new_notification_email(notification, receiver) 
end 

#Sends an email for indicating a new message for the receiver 
def new_notification_email(notification, receiver) 
    @notification = notification 
    @receiver  = receiver 
    set_subject(notification) 

    template_name = "new-notification-email-fr" 
    template_content = [] 
    message = { 
    to: [receiver.send(Mailboxer.email_method, notification)], 
    subject: t('mailboxer.notification_mailer.subject', :subject => @subject), 
    merge_vars: [ 
     {rcpt: receiver.send(Mailboxer.email_method, notification), 
     vars: [ 
      ] 
     } 
     ] 
    } 
    mandrill_client.messages.send_template template_name, template_content, message 
    end 
end 

ответ

0

Я использовал неправильное соглашение об именовании. Это должно было быть

class MailboxerNotificationMailer < Mailboxer::BaseMailer