<?php
namespace App\EventListener;
use App\Event\GeneralAppointmentSubmitEvent;
class GeneralAppointmentListener extends FormSubmitEventListener
{
public function postAppointmentSubmit(GeneralAppointmentSubmitEvent $event)
{
$appointment = $event->getAppointment();
if ($mail = $this->getMail('site_appointment_mail')) {
$this->mailer->mail(
$mail,
$this->getCompanyEmailSender(),
[$appointment->getEmailAddress()],
['appointment' => $appointment]
);
$this->mailer->mail(
$mail,
$this->getCompanyEmailSender(),
[$this->getCompanyEmailaddress()],
['appointment' => $appointment]
);
}
}
}