35 lines
838 B
PHP
35 lines
838 B
PHP
<?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'
|
|
);
|
|
}
|
|
}
|