Skip to content

Commit

Permalink
Allow announcements without messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tomneedham authored and DeepDiver1975 committed Jun 21, 2017
1 parent a2b3d39 commit 2e999fe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@ public function prepare(INotification $notification, $languageCode) {
$announcement = $this->manager->getAnnouncement($notification->getObjectId(), false);
$params[] = str_replace("\n", ' ', $announcement['subject']);

$notification->setParsedMessage($announcement['message'])
->setParsedSubject(
// only set message if present
if(!empty($announcement['message'])) {
$notification->setParsedMessage($announcement['message']);
}

$notification->setParsedSubject(
(string) $l->t('%1$s announced “%2$s”', $params)
);

return $notification;

default:
Expand Down

0 comments on commit 2e999fe

Please sign in to comment.