From 81c0ca2c55d15753581c2c405e0d5e104fad533d Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Thu, 9 Apr 2015 16:01:28 +1200 Subject: [PATCH] Comment notification extensions --- _config/comments.yml | 9 +++++++ code/extensions/BlogPostNotifications.php | 30 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 code/extensions/BlogPostNotifications.php diff --git a/_config/comments.yml b/_config/comments.yml index 54ed4fa..7332db8 100644 --- a/_config/comments.yml +++ b/_config/comments.yml @@ -6,3 +6,12 @@ Only: Comment: extensions: - BlogCommentExtension + +--- +Name: blogcommentnotifications +Only: + moduleexists: 'comment-notifications' +--- +BlogPost: + extensions: + - BlogPostNotifications diff --git a/code/extensions/BlogPostNotifications.php b/code/extensions/BlogPostNotifications.php new file mode 100644 index 0000000..66757b1 --- /dev/null +++ b/code/extensions/BlogPostNotifications.php @@ -0,0 +1,30 @@ +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; + } +}