Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Damian Mooyman
committed
Apr 9, 2015
1 parent
32c1851
commit 81c0ca2
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?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 type $list | ||
* @param type $comment | ||
*/ | ||
public function updateNotificationRecipients(&$list, &$comment) { | ||
// Notify all authors | ||
$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 = "A new comment has been posted on " . $this->owner->Title; | ||
} | ||
} |