title: pass instance variable while using observer pattern in rails
body: <p>I'm using observer pattern in rails. The "delivered_email" method in TestObserver will be called after notification email been sent out. How could I pass the instance variable in "notification" to the "delivered_email"? I could add it either in the header or subject. But it could pose security issue since user who received email could also see the variable. Is there any better way to solve it?</p>
  
  <pre><code>class GeneralMailer &lt; ActionMailer::Base
    def notification(data)
      @emails = data[:emails]
      subject = "#{@sender.to_s}"
      mail(:to =&gt; @emails, :subject =&gt; subject)
    end
  end
  
  class TestObserver
    def self.delivered_email(message)
      begin
        # do something here
        puts @emails
      rescue =&gt; ex
        # do something here
      end
    end
  
  ActionMailer::Base.register_observer(TestObserver)
  </code></pre>