Skip to content

Commit

Permalink
return bool on spool's queing
Browse files Browse the repository at this point in the history
  • Loading branch information
radutopala committed Jun 8, 2016
1 parent 45847b2 commit 5839d9d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Library/AutomailerSpool.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,15 @@ protected function getManager()

protected function save($mail)
{
$manager = $this->getManager();
$manager->persist($mail);
$manager->flush();
try {
$manager = $this->getManager();
$manager->persist($mail);
$manager->flush();

return true;
} catch (\Exception $e) {
return false;
}
}

/**
Expand Down Expand Up @@ -110,7 +116,7 @@ public function queueMessage(\Swift_Mime_Message $message)
$mail->setIsHtml(($message->getContentType() == 'text/html') ? true : false);
$mail->setSwiftMessage($message);

$this->save($mail);
return $this->save($mail);
}

/**
Expand Down

0 comments on commit 5839d9d

Please sign in to comment.