Skip to content

Commit cba0478

Browse files
Refactored the code
1 parent cdcb5c8 commit cba0478

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

service_container.rst

+6-3
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ made. To do that, you create a new class::
365365
->addPart(
366366
'Someone just updated the site. We told them: '.$happyMessage
367367
);
368-
$this->mailer->send($message);
368+
369+
return $this->mailer->send($message) > 0;
369370
}
370371
}
371372

@@ -379,8 +380,10 @@ you can use the service immediately::
379380
{
380381
// ...
381382

382-
$siteUpdateManager->notifyOfSiteUpdate();
383-
$this->addFlash('success', 'Notification mail was sent successfully.');
383+
if ($siteUpdateManager->notifyOfSiteUpdate()) {
384+
$this->addFlash('success', 'Notification mail was sent successfully.');
385+
}
386+
384387
// ...
385388
}
386389

0 commit comments

Comments
 (0)