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