Skip to content

Instantly share code, notes, and snippets.

@objectivehtml
Created December 17, 2013 18:52
Show Gist options
  • Select an option

  • Save objectivehtml/8010532 to your computer and use it in GitHub Desktop.

Select an option

Save objectivehtml/8010532 to your computer and use it in GitHub Desktop.
<?php
public function notification_action()
{
$this->EE->load->library('postmaster_notification', array(
'base_path' => PATH_THIRD.'postmaster/notifications/'
));
$id = $this->EE->input->get_post('id');
if(!$id)
{
return;
}
$notification = $this->EE->postmaster_model->get_notification($id);
if($notification->num_rows() == 0)
{
return;
}
$notification = $notification->row();
if((int) $notification->enabled == 0)
{
return;
}
$notification->settings = json_decode($notification->settings);
$obj = $this->EE->postmaster_notification->load($notification->notification, $notification);
$obj->set_notification($notification);
$this->EE->postmaster_notification->trigger($obj);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment