Sachin,You issue with  event parameter.checkout_onepage_controller_success_action give last order ids in a  array .
You can easy check at class Mage_Checkout_OnepageController  at function successAction.

Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' =&gt; array($lastOrderId)));


your observer code is

&lt;?php
class Metro_Purchaseorder_Model_Observer {

    public function shipmentEmail(Varien_Event_Observer $observer) 
        {
        $orderIds = $observer-&gt;getEvent()-&gt;getOrderIds();
        if (empty($orderIds) || !is_array($orderIds)) {
            return;
        }
        foreach($orderIds as $eachOrderId){
             $order = Mage::getModel('sales/order')-&gt;load($eachOrderId);
            try {
                    $order = Mage::getModel('sales/order')-&gt;load($eachOrderId);
                    $customer = Mage::getModel('customer/customer')-&gt;load($order-&gt;getCustomerId());
                    $payment = $order-&gt;getPayment()-&gt;getMethodInstance()-&gt;getCode();
                    $storeId = $order-&gt;getStoreId();
                    $emailTemplate  = Mage::getModel('core/email_template')-&gt;loadDefault('custom_email_po_template');   
                    $emailTemplateVariables = array();                  
                    $emailTemplateVariables['myvar1'] = 'Branko';
                    $emailTemplateVariables['myvar2'] = 'Ajzele';
                    $emailTemplateVariables['myvar3'] = 'ActiveCodeline';
                    $emailTemplateVariables['storeid'] = $storeId;                  
                    $processedTemplate = $emailTemplate-&gt;getProcessedTemplate($emailTemplateVariables);
                    /*  $emailTemplate-&gt;setSenderName('MetroCC');
                    $emailTemplate-&gt;setSenderEmail('info@metrocc.com');
                    $emailTemplate-&gt;setTemplateSubject($this-&gt;__('PO Test mail'));  */
                    //send mail
                    $emailTemplate-&gt;send('sachin301190@gmail.com', 'sachin', $emailTemplateVariables); 
                    return true;


                }catch (Mage_Core_Exception $e) {
            }
        break;
        }
            return $this;
        }

}


custom email unable to send magento
I would like to hookup a GPS receiver to my Pi so that I can:


Get my geographical position 
Synchronise clock when not connected to network


What are my options? Will any hardware supported by gpsd work with the Pi?
