3

I used a custom static block to put newsletter subscribe at homepage footer:

<div class="bottom_blocks_subscribe">
   {{block type="core/template" template="newsletter/subscribe.phtml"}}
<div>

After entering a email address and press submit it just redirects to homepage. No entry is added to Newsletter Subscribers. Any ideas what the issue is and how to fix?

Any help is much appreciated.

3

Take a look at Magento Newsletter form not working

Try

{{block type="newsletter/subscribe" template="newsletter/subscribe.phtml"}}

The form need to be posted to newsletter/subscriber/new which is define in

Mage_Newsletter_Block_Subscribe

/**
 * Retrieve form action url and set "secure" param to avoid confirm
 * message when we submit form from secure page to unsecure
 *
 * @return string
 */
public function getFormActionUrl()
{
    return $this->getUrl('newsletter/subscriber/new', array('_secure' => true));
}
  • Do you know what the php equivalent of this is? – Omar Sep 17 '15 at 14:30
  • +Omar <?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?> if the block hasn't been added in the layout XML. You can always put it in the layout XML like this <block type="newsletter/subscribe" name="footer.newsletter" as="footer.newsletter" template="newsletter/subscribe.phtml" before="-" /> and then call it like this <?php echo $this->getChildHtml('footer.newsletter'); ?> – Tyler V. Dec 11 '15 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.