Skip to content

Instantly share code, notes, and snippets.

@kuryaki
Created February 3, 2016 14:41
Show Gist options
  • Select an option

  • Save kuryaki/7880261b8d3b6e8c68dd to your computer and use it in GitHub Desktop.

Select an option

Save kuryaki/7880261b8d3b6e8c68dd to your computer and use it in GitHub Desktop.
### Payload
#### Simple text notification for patient or provider
```
{
to: '234',
sender: '987',
text: 'You have a visit scheduled',
channels: ['mail', 'sms']
}
```
**to:** receiver "_id"
**sender:** sender "_id"
**text:** the actual text notification being sent
**channels:** _optional_ array of channels to be used for notification that can be ['ios', 'mail', 'sms', 'socket'] if not set will use all avaliable channels set by [emblem](https://github.com/pagerinc/emblem)
#### Action notification
```
{
action: 'visit_scheduled'
payload: {
visitId: 'someVisitId to gather data from'
}
}
```
**action:** a string that represents the action that is being fired
**payload:** is the data needed for the action, if the payload dont match the action schema the job is rejected/nacked
@cilindrox
Copy link

what about:

{
  event: 'visit_scheduled',
  id: `<visit.id>`
}

Pusher then goes to our user storage, gets the device ids and submits a payload to broadcast || panela || mailman (in that ORed order)

edit: submitted payload should match the described above:

// this gets written on broadcast's queue
{
  to: '234',
  text: 'You have a visit scheduled'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment