PHP Mail with multiple body content

Magento PHP mail function :

class Gta_MerchantNotification_Model_Observer {
    public function merchantremainder($Observer) {
       $order = $Observer->getEvent()->getOrder();
       $order_details = $order->getAllVisibleItems();

       $itemData = array();
       foreach ($order_details as $list) {
          $incrementid = $order->getIncrementId();
          $sku = $list->getsku();
          $name = $list->getName();
          $price = $list->getPrice();
          $Qty = $list->getQtyOrdered();
          $extra = $order->getIncrementId();
          $message = 


          $itemData[$list->getId()] = $message;

      $finalMessage = "<table border='1'>
      <th>Product name</th>
      <th>Qty Ordered</th>
      if (!empty($itemData)) {
          foreach ($itemData as $data) {
             $finalMessage .= $data;

         $finalMessage .= "</table>";


 public function sendMail($message) {
   $body ="$message";
   $emailTemplate = Mage::getModel('core/email');
   $emailTemplate->setSubject("Custom Email from observer");



Now my output like :

What is your question?

See screenshot, i want to add order id : getting value by variable, before table.

Do you know how to get the order ID from $order?

Yes, i know that. I just want print order id above table.

<p>Order Id : $incrementid</p>

this one solve my task.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.