I am using this to generate URL for unsubscribe in email template
<a href="{{var subscriber.getUnsubscriptionLink()}}">{{var subscriber.getUnsubscriptionLink()}}</a>
This only generates this link: http://www.sitename.com/index.php/newsletter/subscriber/unsubscribe/
without any code and id in URL
The method in app\code\core\Mage\Newsletter\Helper\Data.php
looks like this
public function getUnsubscribeUrl($subscriber)
{
return Mage::getModel('core/url')
->setStore($subscriber->getStoreId())
->getUrl('newsletter/subscriber/unsubscribe', array(
'id' => $subscriber->getId(),
'code' => $subscriber->getCode(),
'_nosid' => true
));
}
I have tested it many time using test newsletter option
How can I fix this issue ?
Best Answer
Your call is
subscriber.getUnsubscriptionLink()
, but the function isgetUnsubscribeUrl()
(LINK vs. URL)