I want to add unsubscribe link in the custom email template. I am using code:

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

But it is not working, can anybody help to do this?

  • to use unsubscribe variable in custom email template you have to set it first from your code to send email
    – Piyush
    Oct 30, 2017 at 10:46

2 Answers 2


You need to create custom variable and use in the custom email template. for example:

$unsubscribeUrl = Mage::getModel('newsletter/subscriber')->loadByEmail($email)->getUnsubscriptionLink();
$vars = array('quote' => $quote, 'url' => $url, 'customunsubscribeurl' => $unsubscribeUrl);

Now, You can use "customunsubscribeurl" in custom email template.


Try this code :

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

Or you can try this also :

=> Copy the core file


=> add in your local directory


replace code in endConfirmationSuccessEmail()



    array('subscriber'=>$this, 'unsubscribe' =>$this->getUnsubscriptionLink())

right this code where you want to add unsubscribe link :

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

It may be useful for you :)

  • Any other solution becouse I have tried this. Oct 30, 2017 at 10:35
  • No sir, I have no other solution. I checked it and its working. Oct 30, 2017 at 10:40
  • Can I use "unsubscribe" var outside newsletter email template Oct 30, 2017 at 10:44
  • Nop. It's not possible. Oct 30, 2017 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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