diff --git a/service_container.rst b/service_container.rst index b1e37cdc78a..401a93199b6 100644 --- a/service_container.rst +++ b/service_container.rst @@ -365,9 +365,8 @@ made. To do that, you create a new class:: ->addPart( 'Someone just updated the site. We told them: '.$happyMessage ); - $this->mailer->send($message); - - return $happyMessage; + + return $this->mailer->send($message) > 0; } } @@ -381,8 +380,10 @@ you can use the service immediately:: { // ... - $message = $siteUpdateManager->notifyOfSiteUpdate(); - $this->addFlash('success', $message); + if ($siteUpdateManager->notifyOfSiteUpdate()) { + $this->addFlash('success', 'Notification mail was sent successfully.'); + } + // ... }