Files
2025-11-14 11:34:40 +01:00

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'
);
}
}