Skip to content

Instantly share code, notes, and snippets.

@Casperhr
Created July 25, 2015 00:23
Show Gist options
  • Select an option

  • Save Casperhr/64e196fb57e30c030940 to your computer and use it in GitHub Desktop.

Select an option

Save Casperhr/64e196fb57e30c030940 to your computer and use it in GitHub Desktop.
// determine notification type
if ($this->request->data['Message']['send_as_push'] == false) {
// Mark push notification as sent if msg should not be pushed
$this->request->data['Message']['is_push_send'] = true;
} else {
$this->request->data['Message']['is_push_send'] = false;
}
foreach ($recepients as $r) {
$this->request->data['Message']['reciever_user_id'] = $r['FrontendUser']['id'];
debug($this->request->data);
$this->Message->create();
$result = $this->Message->save($this->request->data);
if (!$result) {
debug($this->Message->validationErrors);
die('LOL');
}
}
$this->Session->setFlash($flashMsg, 'flash/success');
$this->redirect($this->referer());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment