1

First of all this concerns magento. I want to have a newsletter with a standard header and footer. This header and footer are being built through static blocks. How can i add a dynamic unsubscribe option in the static footer block? (an unsubscribe per customer) And should this not be possible, how can I do it through other means?

Any help would be most welcome.

1 Answers1

0

First create a static block and call phtml from static block The code of .phtml file

call in a phtml file in static block

   {{block type="core/template" template="newsletter/unsci.phtml" 
name="newsletterall" }}

Create a phtml in unsci.phtml under app/design/frontend/yourpackage/youtemplate/newsletter

Call a static block like the code is below-

If you want only to unsubscribe then you should add below code in phtml file

<?php        $subscriber = Mage::getModel('newsletter/subscriber')
                    ->loadByEmail("dev.amit.bera@gmail.com")
 if( $subscriber->getId()){ 
            $unscibeurl=Mage::helper('newsletter')->getUnsubscribeUrl($subscriber); ?>
    <a href="<?php echo echo $unscibeurl; ?>">Un subcribe</a>
<?php } ?>

Call static block in anywhere using below code

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId($indenfirename)->toHtml();  ?>
Dushyant Joshi
  • 3,672
  • 3
  • 28
  • 52
Amit Bera
  • 7,581
  • 7
  • 31
  • 57