/** * @param boolean|null $delayed * @throws CM_Exception_Invalid */ public function send($delayed = null) { $delayed = (bool) $delayed; if (empty($this->_to)) { throw new CM_Exception_Invalid('No recipient specified.'); } $verificationMissing = $this->_verificationRequired && $this->_recipient && !$this->_recipient->getEmailVerified(); if ($verificationMissing) { return; } list($subject, $html, $text) = $this->render(); if ($delayed) { $this->_queue($subject, $text, $html); } else { $this->_send($subject, $text, $html); } }