title: Magento Get Last Order Id on Payment Info Block Email
body: <p><img src="https://i.stack.imgur.com/IY3Hy.jpg" alt="Magento New Order Email"></p>
  
  <p>See above is a picture of new order acknowledgement email of Magento.
  On the website we're developing we use Fontis Australia extension (<a href="http://www.magentocommerce.com/magento-connect/fontis-australia.html" rel="nofollow noreferrer">http://www.magentocommerce.com/magento-connect/fontis-australia.html</a>) to implement BPay payment method. The extension works ok, except that on the order acknowledgement email, the Email ref always show 000000.</p>
  
  <p>I try to look at it and see that the ref number generated need the order ID as input to generate the correct ref number. 
  The extension use this code to get the last order number on payment info block:
      $order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId(); </p>
  
  <p>I try to use and print the result from other controller, it shows the correct order number. But seems that for the payment info block on email, the order number info can't be retrieved. Actually the same block also called out on the checkout success page, and it shows correctly.</p>
  
  <p>Can somebody suggest other way to get the last order id on payment info block on Magento Email?</p>