Transport
Send a message through one of the available transport channels.
SendEmail
core.SendEmail({...})
Send an email
- Object
to: Emailsubject: String!message: String!reply: StringEmail reply toname: StringEmail display namefrom: StringEmail from (must be an approved domain)
Boolean
SendText
core.SendText({...})
Send an SMS message
- Object
to: Stringvalid cell phone number with country code and area codemessage: String!text message; limited to 160 characters in many regions
Boolean
SendChat
core.SendChat({...})
Send a chat messgae to a group channel
- Object
to: UUID!channel id to send tofrom: UUID!user Id to send frombody: Stringdisplay messagedata: Lua Tabledata for the messagekind: enumdirect | group | ad-hoc | org | self | managed | dispatch | dataschema:text.jsonor other schema id
Boolean
local body1 = "hello yo (a)"
core.SendChat({
from="<sender id>",
to="99de4ae7-0597-4ffd-a862-c1358507eb43",
kind="ad-hoc",
data={text=body1},
schema="text.json",
body=body1
})
SendDirectChat
core.SendDirectChat({...})
Send a chat message to a user via direct chat
- Object
to: UUID!user id to send tofrom: UUID!user Id to send frommessage: Stringmessagedata: Lua Tabledata for the message
Boolean
local body2 = "hello yo (b)"
core.SendDirectChat({
from="<sender id>",
to="b213c95c-d88e-4add-a047-902e38253043",
body=body2,
kind="direct",
data={text=body2},
schema="text.json"
})
SendManagedChat
core.SendManagedChat({...})
Send a chat message to a managed channel for a user
- Object
to: UUID!user id to send tofrom: UUID!user Id to send frommessage: Stringmessagedata: Lua Tabledata for the message
Boolean
core.SendManagedChat({
to="b213c95c-d88e-4add-a047-902e38253043",
from="<sender id>",
channel="519465c0-cc53-4fec-b9a3-7810a717729e",
data={text="hello there!.. again"},
schema="text.json",
kind="managed",
body="hello b"
})
SendNotification
core.SendNotification({...})
Send notification message
- Object
to: UUID!user id to send tobody: Stringmessagetitle: Stringnotification messagekind: enumselfschema:text.jsonor other schema id
Boolean
core.SendNotification({
to="b213c95c-d88e-4add-a047-902e38253043",
body="hey there notification again yo",
title="really important stuff",
schema="text.json",
kind="self"
})
InvokeInbox
core.InvokeInbox({...})
Initiate an inbox workflow
- Object
id: UUID!inbox idrecipient: UUID!recipient iddata: Lua Tabledata object used by the inboxserviceId: Stringoptional globally unique string for the inbox; only one instance will be sent (nothing will be done if the service ID already exists)dispatchId: Stringoptional dispatch ID to use for invoking the inbox
Boolean
SendNotification
core.SendNotification({...})
Send notification to self channel
- Object
id: UUID!inbox idrecipient: UUID!recipient iddata: Lua Tabledata object used by the inboxserviceId: Stringoptional globally unique string for the inbox; only one instance will be sent (nothing will be done if the service ID already exists)dispatchId: Stringoptional dispatch ID to use for invoking the inbox
Boolean
SendPush
core.SendPush({...})
Send a push notification to a specific user
- Object
id: UUID!user id to send totitle: Stringtitlemessage: Stringmessage
Boolean
InvokeTunnel
core.InvokeTunnel({...})
Invoke a behavior trigger in another org. Receiving org should check the originId to confirm this is an expected script invokation.
- Object
orgId: UUID!org id of target orghandle: Stringhandle of target behaviordata: Anydata object to pass
Boolean
core.InvokeTunnel({
orgId="<destination org>",
handle="<target trigger>",
data={blob={a="test1", b="test2"}}
})
Send Chat
core.SendChat({...})
core.SendChat({
to="5aa21c...1e339",
from="aeebf9...0c5f9cd",
channel="5aa21c...1e339",
data={
text="yo!",
data_schema="text.json"
},
schema="text.json",
kind="org",
body="yo!",
notifyMode="none",
event="weave.chat"
})