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; + } +}