2015-04-09 16:01:28 +12:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2015-05-10 02:33:12 +12:00
|
|
|
* Customise blog post to support comment notifications.
|
|
|
|
*
|
|
|
|
* Extends {@see BlogPost} with extensions to {@see CommentNotifiable}.
|
2015-04-09 16:01:28 +12:00
|
|
|
*/
|
2015-11-21 19:17:29 +13:00
|
|
|
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();
|
|
|
|
}
|
2015-04-09 16:01:28 +12:00
|
|
|
|
2015-11-21 19:17:29 +13:00
|
|
|
/**
|
|
|
|
* Update comment to include the page title.
|
|
|
|
*
|
|
|
|
* @param string $subject
|
|
|
|
* @param Comment $comment
|
|
|
|
* @param Member|string $recipient
|
|
|
|
*/
|
|
|
|
public function updateNotificationSubject(&$subject, &$comment, &$recipient)
|
|
|
|
{
|
2016-01-25 18:23:27 +07:00
|
|
|
$subject = sprintf('A new comment has been posted on %s', $this->owner->Title);
|
2015-11-21 19:17:29 +13:00
|
|
|
}
|
2015-04-09 16:01:28 +12:00
|
|
|
}
|