Skip to content

Commit

Permalink
[FEATURE] Add event listener to handle LuxletterLinkLuxIdentification…
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeldesu committed Jan 27, 2025
1 parent 3c9b3e1 commit 65f03a8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Classes/Hooks/LuxletterLinkLuxIdentificationHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);
namespace In2code\Lux\Hooks;

use In2code\Lux\Utility\CookieUtility;
use In2code\Luxletter\Events\LuxletterLinkLuxIdentificationEvent;
use TYPO3\CMS\Core\Attribute\AsEventListener;

#[AsEventListener(
identifier: 'lux/handle-luxletter-link-lux-identification',
event: LuxletterLinkLuxIdentificationEvent::class
)]
class LuxletterLinkLuxIdentificationHandler
{
public function __invoke(LuxletterLinkLuxIdentificationEvent $event)
{
if ($event->isIdentification()) {
$link = $event->getLink();
CookieUtility::setCookie('luxletterlinkhash', $link['hash']);
}
}
}

0 comments on commit 65f03a8

Please sign in to comment.