Q:

Get customer account details for invoice PDF

I need to get the account details of a registered customer and use them in the invoice PDF.  The customer belongs to customer group "testgroup".  By using the order details I can get the customer group and check if the customer belongs to "testgroup".  
How do I get the customer ID and the rest of the account details? 

A:

Given $order, I can get the email from the order like this:
$customer_email = $order->getCustomerEmail();

Then I can get the account details with the following code: 

$customer = Mage::getModel("customer/customer"); 
$customer->setWebsiteId(Mage::app()->getWebsite()->getId()); 
$customer->loadByEmail($customer_email); 
echo $customer->getId(); 
echo $customer->getFirstName(); 
print_r($customer->getData());  

Credit: http://www.techdilate.com/code/magento-get-customer-details-by-email-id/

