protected function flushEmail(SpoolEmailInterface $email): void
    {
        $email->setSentAt(new \DateTime());
        $this->om->persist($email);
        $this->om->flush();

        if (SpoolEmailStatus::STATUS_SUCCESS === $email->getStatus()) {
            $this->om->remove($email);
            $this->om->flush();
        }

        $this->om->detach($email);
    }
protected function flushEmail(SpoolEmailInterface $email): void
    {
        $email->setSentAt(new \DateTime());
        $this->om->persist($email);
        $this->om->flush();

        if (SpoolEmailStatus::STATUS_SUCCESS === $email->getStatus()) {
            $this->om->remove($email);
            $this->om->flush();
        }

        $this->om->detach($email);
    }
protected function flushEmail ( SpoolEmailInterface $ email ) : void { $ email -> setSentAt ( new \ DateTime ( ) ) ; $ this -> om -> persist ( $ email ) ; $ this -> om -> flush ( ) ; if ( SpoolEmailStatus :: STATUS_SUCCESS === $ email -> getStatus ( ) ) { $ this -> om -> remove ( $ email ) ; $ this -> om -> flush ( ) ; } $ this -> om -> detach ( $ email ) ; }
Update and flush the spool email.

@param SpoolEmailInterface $email The spool email
Update and flush the spool email .