public function send() { if (!$this->records) { $this->setRecords(ContentNotifierQueue::get_unnotified()); } ContentNotifierExtension::disable_filtering(); $total = $this->records->count(); $grouped = GroupedList::create($this->records->limit($this->config()->items_limit))->GroupedBy('Category'); $this->emailer->populateTemplate(array('Headline' => $this->config()->headline, 'GroupedItems' => $grouped, 'Total' => $total, 'Link' => Controller::join_links(Director::absoluteBaseURL(), 'admin', 'content-notifications'))); $this->emailer->send(); foreach ($this->records as $record) { $record->HasNotified = true; $record->write(); } ContentNotifierExtension::enable_filtering(true); }