silverstripe-blog/code/extensions/BlogPostNotifications.php
Christopher Pitt 787c02a19d Clean up
2015-05-11 10:11:21 +12:00

30 lines
727 B
PHP

<?php
/**
* Customise blog post to support comment notifications.
*
* Extends {@see BlogPost} with extensions to {@see CommentNotifiable}.
*/
class BlogPostNotifications extends DataExtension {
/**
* Notify all authors of notifications.
*
* @param SS_List $list
* @param mixed $comment
*/
public function updateNotificationRecipients(&$list, &$comment) {
$list = $this->owner->Authors();
}
/**
* Update comment to include the page title.
*
* @param string $subject
* @param Comment $comment
* @param Member|string $recipient
*/
public function updateNotificationSubject(&$subject, &$comment, &$recipient) {
$subject = sprintf('A new comment has been posted on ', $this->owner->Title);
}
}