-2

The link provided doesn't work! Any solution guys?

{{var subscriber.getUnsubscriptionLink()}}">{{var subscriber.getUnsubscriptionLink()}}
1

Try this one in transactional emails

<a href="{{var subscriber.getUnsubscriptionLink()}}">
{{var subscriber.getUnsubscriptionLink()}}
</a>

You can also try this one

Copy the core file

/app/code/core/Mage/Newsletter/Model/Subscriber.php

to your local directory

/app/code/local/Mage/Newsletter/Model/Subscriber.php

Open in editor to edit the code and search the function sendConfirmationSuccessEmail() replace the code

$email->sendTransactional(
    Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE),
    Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY),
    $this->getEmail(),
    $this->getName(),
    array('subscriber'=>$this)
);

with this

$email->sendTransactional(
    Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE),
    Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY),
    $this->getEmail(),
    $this->getName(),
    array('subscriber'=>$this, 'unsubscribe' =>$this->getUnsubscriptionLink())
);

and place this code in email template where you want to use unsubscribe link:

<a href="{{var unsubscribe}}">Unsubscribe here</a>

That's it!

Update Potentially try {{var subscriber.getUnsubscriptionLink()}}

  • Thanks. But it is the same code i have already! See above in my question. This doesn't work... – Hassan Hafez Feb 9 '16 at 9:25
  • Updated it maybe you can try that one – Klettseb Feb 9 '16 at 9:46
  • It worked for me but not with {{var unsubscribe}} but with {{var subscriber.getUnsubscriptionLink()}} Thanks – Freejoy Nov 1 '17 at 16:15

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.