|
|
@@ -37,16 +37,16 @@ class MailHub
|
|
|
throw new \RuntimeException('Access has no principal email address, abort');
|
|
|
}
|
|
|
/** @noinspection NullPointerExceptionInspection */
|
|
|
- $to = new Address($contactPoint->getEmail(), $access->getPerson()->getFullName());
|
|
|
+ $to = new Address($contactPoint->getEmail(), $access->getPerson()->getFullName() ?? $access->getPerson()->getUsername());
|
|
|
|
|
|
- $context = ['_address' => $to];
|
|
|
+ $context = ['_to' => $to];
|
|
|
$context = array_merge($context, $data);
|
|
|
|
|
|
$email = (new TemplatedEmail())
|
|
|
->from($this->opentalentNoReplyEmailAddress)
|
|
|
->to($to)
|
|
|
->subject($subject)
|
|
|
- ->htmlTemplate('@templates/mail/' . $template . '.html.twig')
|
|
|
+ ->htmlTemplate('@templates/emails/' . $template . '.html.twig')
|
|
|
->context($context);
|
|
|
|
|
|
$this->mailer->send($email);
|