<?php
namespace App\EventListener;
use App\Event\CompanyCreatedEvent;
class CompanyCreatedListener extends FormSubmitEventListener
{
public function postCreate(CompanyCreatedEvent $event)
{
$company = $event->getCompany();
if (!($mail = $this->getMail('site_multiposter_mail_owner')) || !$company) {
return;
}
$this->mailer->mail(
$mail,
$this->getCompanyEmailSender(),
[$this->parameterBag->get('site_company_email_address')],
['company' => $company]
);
}
public function postCreateByUser(CompanyCreatedEvent $event)
{
if ($mail = $this->getMail('site_user_created_company_mail_owner')) {
$this->mailer->mail(
$mail,
$this->getCompanyEmailSender(),
[$this->parameterBag->get('site_company_email_address')],
['company' => $event->getCompany()]
);
}
}
}