2016-05-02 3 views
0

に単一のメソッドから複数のメールを送信する私は、単純なメーラーactionmailerの

class ApplyMailer < ActionMailer::Base 
    def inform_teacher 
    end 

    def inform_division 
    end 

    def inform_everyone 
    inform_teacher.deliver 
    inform_division.deliver 
end 
end 

inform_teacherを呼び出すとinform_divisionすべてがうまく動作しています。しかし、私がinform_everyoneに電話しようとすると、1つの空のメールが届くだけです。

1つの方法で複数のメールメソッドを組み合わせることはできますか?これに

答えて

0

見つかりソリューション:

class ApplyMailer < ActionMailer::Base 
    def inform_teacher 
    end 

    def inform_division 
    end 

    def self.inform_everyone 
    ApplyMailer.inform_teacher.deliver 
    ApplyMailer.inform_division.deliver 
end 
end