chore: complete update

This commit is contained in:
2025-07-17 16:24:20 +02:00
parent 899227b0a4
commit 64a7051137
1300 changed files with 85570 additions and 2756 deletions

View File

@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
namespace App\Application\Newsletter\SignUp;
use App\Framework\CommandBus\CommandHandler;
use App\Framework\EventBus\EventBus;
use App\Infrastructure\Api\RapidMailClient;
use Archive\Config\ApiConfig;
final readonly class NewsletterSignupHandler
{
public function __construct(
private EventBus $eventBus,
) {}
#[CommandHandler]
public function __invoke(SignupUserToNewsletter $command):void
{
// RapidMail-Client erstellen und konfigurieren
$client = new RapidMailClient(
ApiConfig::RAPIDMAIL_USERNAME->value,
ApiConfig::RAPIDMAIL_PASSWORD->value
);
// Abonnent zur Liste hinzufügen
$result = $client->addRecipient(
$command->name,
$command->email,
ApiConfig::getRapidmailListId()
);
error_log('CommandHandler für: '.$command->email);;
$this->eventBus->dispatch(new UserWasSignedUp($command->email));
}
}