Skip to content

Commit

Permalink
Return true/false from Mail\Service::sendMail
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Nov 12, 2016
1 parent c128b11 commit 0f224c2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/concrete/src/Mail/Service.php
Expand Up @@ -395,6 +395,8 @@ public function setAdditionalHeaders($headers)
* @param bool $resetData Whether or not to reset the service to its default values.
*
* @throws \Exception
*
* @return bool
*/
public function sendMail($resetData = true)
{
Expand Down Expand Up @@ -492,10 +494,12 @@ public function sendMail($resetData = true)
}
$mail->setBody($body);

$sent = false;
try {
if (Config::get('concrete.email.enabled')) {
$transport->send($mail);
}
$sent = true;
} catch (Exception $e) {
if ($this->getTesting()) {
throw $e;
Expand Down Expand Up @@ -533,5 +537,7 @@ public function sendMail($resetData = true)
if ($resetData) {
$this->reset();
}

return $sent;
}
}

0 comments on commit 0f224c2

Please sign in to comment.