title: Magento trigger observer with custom orderstatus
body: <p>I'm creating a Magento module and I want the Observer to trigger when my custom orderstatus is chosen.</p>
  
  <p>Practical situation:
  People select: 'Payment Received' the <code>//DO STUFF</code> in the Observer is triggered.</p>
  
  <p>This ain't working, so what is wrong here? (the status shows up correctly though) :-(</p>
  
  <p><strong>config.xml:</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;config&gt;
      &lt;modules&gt;
          &lt;MOD_PaidStatus&gt;
              &lt;version&gt;1.0.0&lt;/version&gt;
          &lt;/MOD_PaidStatus&gt;
      &lt;/modules&gt;
      &lt;global&gt;
          &lt;sales&gt;
              &lt;order&gt;
                  &lt;statuses&gt;
                      &lt;payment_received translate="label"&gt;&lt;label&gt;Payment Received&lt;/label&gt;&lt;/payment_received&gt;
                  &lt;/statuses&gt;
                  &lt;states&gt;
                      &lt;processing translate="label"&gt;
                          &lt;label&gt;Processing&lt;/label&gt;
                          &lt;statuses&gt;
                              &lt;processing default="1"/&gt;
                              &lt;payment_received default="2" /&gt;
                          &lt;/statuses&gt;
                          &lt;visible_on_front/&gt;
                      &lt;/processing&gt;
                      &lt;pending translate="label"&gt;
                          &lt;label&gt;Pending&lt;/label&gt;
                          &lt;statuses&gt;
                              &lt;pending default="1"/&gt;
                              &lt;payment_received default="2" /&gt;
                          &lt;/statuses&gt;
                          &lt;visible_on_front/&gt;
                      &lt;/pending&gt;
                  &lt;/states&gt;                  
              &lt;/order&gt;            
          &lt;/sales&gt; 
          &lt;events&gt;
                  &lt;sales_order_resource_save_attribute_after&gt;
                          &lt;observers&gt;
                                  &lt;PaidStatus&gt;                                        
                                          &lt;class&gt;MOD_PaidStatus/observer&lt;/class&gt;         
                                          &lt;method&gt;observeAttributeChange&lt;/method&gt;
                                          &lt;type&gt;singleton&lt;/type&gt;
                                  &lt;/PaidStatus&gt;
                          &lt;/observers&gt;
                  &lt;/sales_order_resource_save_attribute_after&gt;
          &lt;/events&gt;
      &lt;/global&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>And my <strong>Observer.php</strong> looks like:</p>
  
  <pre><code>class MOD_PaidStatus_Model_Observer {
  
  public function observeAttributeChange($observer){
      $attribute = $observer-&gt;getEvent()-&gt;getAttribute();
      if  ($attribute-&gt;getAttributeCode() == 'status') {
          mail('test@testcase.com', 'testcase', 'foo bar?');
      }
  }
  </code></pre>
  
  <p>}</p>