-
Notifications
You must be signed in to change notification settings - Fork 191
postal.publish
Jim Cowart edited this page May 10, 2014
·
5 revisions
description: publishes a message.
There are two ways to publish messages in postal - using postal.publish
or calling publish
on a ChannelDefinition
instance. The postal.publish
method call is provided for convenience so that you don't always need a reference to a ChannelDefinition
in order to publish.
-
envelope
- an object that contains:-
channel
- (optional) channel name (string). UsesDEFAULT_CHANNEL
if no channel is provided. -
topic
- (required!) the topic string -
data
- (optional) value of any type. This is effectively the message body.
-
Example Usage:
var env = postal.publish({
channel: "greeting",
topic: "say.hello",
data: {
firstName: "Bugs",
lastName: "Bunny"
}
});