<?php
declare(strict_types=1);
namespace BitBag\OpenMarketplace\Component\Vendor\EventListener;
use BitBag\OpenMarketplace\Component\Messaging\Event\ConversationCreated;
use BitBag\OpenMarketplace\Component\Messaging\Event\ConversationUpdated;
use BitBag\OpenMarketplace\Component\Vendor\Email\VendorEmailManagerInterface;
final class ConversationListener
{
public function __construct(
private VendorEmailManagerInterface $vendorEmailManager,
) {
}
public function onConversationCreated(ConversationCreated $event): void
{
$this->vendorEmailManager->sendConversationCreatedEmail($event->getConversation());
}
public function onConversationUpdated(ConversationUpdated $event): void
{
$this->vendorEmailManager->sendConversationUpdatedEmail($event->getMessage());
}
}