Skip to content

Instantly share code, notes, and snippets.

@nyeholt
Created January 11, 2016 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nyeholt/baef932f3fc4b3ccdd71 to your computer and use it in GitHub Desktop.
Save nyeholt/baef932f3fc4b3ccdd71 to your computer and use it in GitHub Desktop.
<?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