Magento Questions get customer details and onepage/checkout/success doesn't sending email

Magento Questions get customer details and onepage/checkout/success doesn't sending email

July 18, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Questions get customer details and onepage/checkout/success doesn't sending email

Retrieving Customer Details in Magento Checkout Process

As a senior developer working primarily with e-commerce platforms like Magento, I often encounter challenges related to retrieving customer data during the checkout process. In this post, I’ll address your specific issue with getting customer details and ensuring proper email notifications on onepage/checkout/success.

Understanding the Current Implementation

You’ve already implemented the getStandardCheckoutFormFields method in your model, which retrieves order information including product name, quantity, and price for each item. The main controller action redirectAction() is also correctly set up to handle redirection after payment processing.

However, you’re facing two primary issues:

  1. Retrieving customer details: You want to get additional customer information like the customer’s name and address to pass it along with the order data.
  2. Email notifications on success page: After successful payment, an email should be sent to the customer confirming their order.

Getting Customer Details

To retrieve customer details, you can modify your existing model method as follows:

public function getStandardCheckoutFormFields()
{
    $orderIncrementId = $this->getCheckout()->getLastRealOrderId();
    $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);

    // Load customer details from the order
    $customer = Mage::getModel('customer/customer')
        ->setStoreId(Mage::app()->getStore()->getId())
        ->load($order->getCustomerId());

    $productArray = array();

    foreach ($order->getAllItems() as $item) {
        $productArray[] = array(
            "product_name"  => $item->getName(),
            "product_qty"   => $item->getQtyOrdered(),
            "product_price" => $item->getPrice(),
        );
    }

    return array_merge($productArray, array(
        'customer_name' => $customer->getName(),
        'customer_email' => $customer->getEmail(),
        'billing_address_street' => $customer->getBillingAddress()->getStreetFull(),
        // Add other required customer fields
    ));
}

In this updated version, I’ve used the customer ID from the loaded order to retrieve the corresponding customer object. Then, it fetches various customer details like name, email, and billing address to include in the returned array along with product data.

Ensuring Email Notifications on Success Page

The issue with emails not being sent on the success page usually arises due to a misconfiguration or override of Magento’s default behavior.

To ensure emails are sent properly after an order is placed successfully:

  1. Check email template configuration: Make sure that you have enabled and configured all required email templates under System > Configuration > Sales > Sales Emails in your Magento admin panel. Ensure that the ‘New Order’ template is enabled for both ‘Guest Checkout’ and ‘Customer Group’.

  2. Review order status changes: Magento sends emails when an order status changes from ‘pending’ to ‘processing’. Check if there are any custom extensions or overrides interfering with this default behavior.

  3. Inspect observer events: Magento uses observers to trigger email sending. You can check if the sales_order_place_after event is correctly configured in your custom modules or local.xml file.

Conclusion and Further Reading

Retrieving customer details during the checkout process and ensuring proper email notifications require a deep understanding of Magento’s core functionality.

In this post, I’ve shown you how to modify your existing model method to get additional customer information. To resolve the issue with emails not being sent on the success page, I recommend thoroughly reviewing your configuration settings, extensions, and event observers related to order placement and email sending in Magento.

For more detailed guidance on customizing the checkout process and order management in Magento, consider exploring our comprehensive suite of e-commerce development services at Laravel Company.

Remember that proper data validation and security are crucial when dealing with customer data. Always ensure that any sensitive information is handled securely according to best practices.

If you encounter further issues or need assistance, feel free to reach out to our expert team for consultation or custom development solutions tailored to your specific needs.

Checkout Catalog Email Orders

Our network