Created
January 11, 2016 23:59
-
-
Save nyeholt/baef932f3fc4b3ccdd71 to your computer and use it in GitHub Desktop.
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
<?php | |
class Page extends SiteTree implements NotifiedOn { | |
private static $db = array( | |
); | |
private static $has_one = array( | |
); | |
public function requireDefaultRecords() { | |
if (Director::isDev()) { | |
$loader = new FixtureLoader(); | |
$loader->loadFixtures(); | |
} | |
} | |
public function onAfterPublish() { | |
singleton('NotificationService')->notify('OBJECT_SAVED', $this); | |
} | |
public function getAvailableKeywords() { | |
$helper = new NotificationHelper($this); | |
return $helper->getAvailableKeywords(); | |
} | |
public function getNotificationTemplateData() { | |
return $this->toMap(); | |
} | |
public function getRecipients($event) { | |
return array(ArrayData::create(array('Email' => 'marcus@silverstripe.com.au'))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment