silverstripe-blog/code/extensions/BlogPostNotifications.php

30 lines
727 B
PHP
Raw Normal View History

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