<?php
namespace App\EventListener;
use App\Event\FeedbackSubmitEvent;
class FeedbackListener extends FormSubmitEventListener
{
public function postFeedbackSubmit(FeedbackSubmitEvent $event)
{
$feedback = $event->getFeedback();
if ($guestMail = $this->getMail('feedback_mail_visitor')) {
$this->mailer->mail(
$guestMail,
$this->getCompanyEmailSender(),
[$event->getFeedback()->getEmail()],
['feedback' => $feedback]
);
}
if ($siteOwnerMail = $this->getMail('feedback_mail_site_owner')) {
$this->mailer->mail(
$siteOwnerMail,
$this->getCompanyEmailSender(),
[$this->getCompanyEmailaddress()],
['feedback' => $feedback]
);
}
}
}