FIX: newsletter - adding unsubscribe link
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
class Ps_EmailsubscriptionUnsubscribeModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
/** @var string */
|
||||
protected $message = '';
|
||||
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
$token = Tools::getValue('token');
|
||||
|
||||
if (!$token) {
|
||||
$this->message = $this->module->trans(
|
||||
'Invalid unsubscribe link.',
|
||||
[],
|
||||
'Modules.Emailsubscription.Shop'
|
||||
);
|
||||
} else {
|
||||
$this->message = $this->module->unsubscribeByToken($token);
|
||||
}
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->context->smarty->assign('message', $this->message);
|
||||
$this->setTemplate(
|
||||
'module:ps_emailsubscription/views/templates/front/unsubscribe_execution.tpl'
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user