I am creating an extension to add PublishSend form action button to Page.
class EmailPageExtension extends DataExtension {
private static $many_many = array(
'Subscribers' => 'Member'
);
public function doPublishSend($data, $form){
$task = singleton('PagePublishSendTask');
if ($task) {
$task->run($this->request);
}
if (Director::is_ajax()) {
return $this->getResponseNegotiator()->respond($this->request);
} else {
$this->redirectBack();
}
}
public function updateCMSActions(FieldList $actions)
{
//Create the new action
$sendButton = FormAction::create('doPublishSend', _t('Email.SendButtonTitle','Send Email'));
//$sendButton->describe(_t("Email.SendButtonDescrption","Publish and Email this item"));
//add it to the existing actions
$actions->unshift($sendButton);
return $actions;
}
}
Button is showing on the edit page.But control does not go to function doPublishSend();