I get the following error:
"exception 'exception' with message 'this letter cannot be sent.' magento" , in magento php.
below is the code i have used.

Observer.php

&lt;?php
class Metro_Purchaseorder_Model_Observer extends Mage_Core_Model_Abstract
{ 
    public function shipmentEmail($observer)
                {
                    $event = $observer-&gt;getEvent();
                    if(!$order = $event-&gt;getOrder())
                    {
                                    $order_Id = Mage::getSingleton('checkout/type_onepage')-&gt;getCheckout()
                      -&gt;getLastOrderId();
                                    $order = Mage::getModel('sales/order')-&gt;load($order_Id);
                                    $customer = Mage::getModel('customer/customer')-&gt;load($order-&gt;getCustomerId());
                    }
                    $payment = $order-&gt;getPayment()-&gt;getMethod();
                    $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;
                }       
}


in Config.xml

------------------------------
&lt;?xml version="1.0"?&gt;
&lt;config&gt;
   &lt;modules&gt;
        &lt;Metro_Purchaseorder&gt;
            &lt;version&gt;0.1.0&lt;/version&gt;
        &lt;/Metro_Purchaseorder&gt;
    &lt;/modules&gt;
          &lt;frontend&gt;
            &lt;events&gt;
                &lt;checkout_onepage_controller_success_action&gt;
                    &lt;observers&gt;
                        &lt;purchaseorder_observer&gt;
                            &lt;type&gt;singleton&lt;/type&gt;
                            &lt;class&gt;Metro_Purchaseorder_Model_Observer&lt;/class&gt;
                            &lt;method&gt;shipmentEmail&lt;/method&gt;
                        &lt;/purchaseorder_observer&gt;
                    &lt;/observers&gt;
                &lt;/checkout_onepage_controller_success_action&gt;
            &lt;/events&gt;
            &lt;/frontend&gt;
                &lt;global&gt;
                  &lt;template&gt;
                        &lt;email&gt;                     
                                &lt;purchaseorder_custom_email1 translate="label" module="purchaseorder"&gt;
                                        &lt;label&gt;Purchaseorder module&lt;/label&gt;
                                        &lt;file&gt;sales/purchaseorder_custom_email1.html&lt;/file&gt;
                                        &lt;type&gt;html&lt;/type&gt;
                                &lt;/purchaseorder_custom_email1&gt;
                        &lt;/email&gt;
                        &lt;/template&gt;      
                  &lt;/global&gt;    
&lt;/config&gt;


Please help me in correcting the above error for sending custom email template


Question: Adding price-alert link to category list views
Answer: As you might already figured out: Your problem is, you need a bunch of blocks, not a single one. Because you need for every product your own block.


So you either achieve this, by setting the product in the registry (this might be done already by magento, please check) and then just use the product from the registry
or you create a block for every product, as you already do.


Make sure if you use 1. that you don't save any product specific states in the block!