Skip to content

Commit df427a7

Browse files
committed
minor #8339 [DI] fix flash message generation (xabbuh, javiereguiluz)
This PR was merged into the 3.3 branch. Discussion ---------- [DI] fix flash message generation see #8224 (comment) Commits ------- cba0478 Refactored the code cdcb5c8 fix flash message generation
2 parents 456ce9f + cba0478 commit df427a7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

service_container.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,8 @@ made. To do that, you create a new class::
370370
->addPart(
371371
'Someone just updated the site. We told them: '.$happyMessage
372372
);
373-
$this->mailer->send($message);
374-
375-
return $happyMessage;
373+
374+
return $this->mailer->send($message) > 0;
376375
}
377376
}
378377

@@ -386,8 +385,10 @@ you can use the service immediately::
386385
{
387386
// ...
388387

389-
$message = $siteUpdateManager->notifyOfSiteUpdate();
390-
$this->addFlash('success', $message);
388+
if ($siteUpdateManager->notifyOfSiteUpdate()) {
389+
$this->addFlash('success', 'Notification mail was sent successfully.');
390+
}
391+
391392
// ...
392393
}
393394

0 commit comments

Comments
 (0)