src/Service/MailService.php
private function createMailEvent(
        Email $email,
        string $name,
        ResultInterface $result = null
    ): MailEvent {
        $event = new MailEvent($email, $name);
        if ($result !== null) {
            $event->setResult($result);
        }

        return $event;
    }
private function createMailEvent(
        Email $email,
        string $name,
        ResultInterface $result = null
    ): MailEvent {
        $event = new MailEvent($email, $name);
        if ($result !== null) {
            $event->setResult($result);
        }

        return $event;
    }
Creates a new MailEvent object
@param Email $email
@param string $name
@param ResultInterface $result
@return MailEvent