Skip to content

Instantly share code, notes, and snippets.

@dannyrandall
Created February 11, 2021 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannyrandall/563728e4166a8dc74127a78aef814e92 to your computer and use it in GitHub Desktop.
Save dannyrandall/563728e4166a8dc74127a78aef814e92 to your computer and use it in GitHub Desktop.
ruleset twilio_app {
meta {
name "Twilio App"
author "Daniel Randall"
use module twilio
with
accountSID = meta:rulesetConfig{"accountSID"}
authToken = meta:rulesetConfig{"authToken"}
}
rule sendSMS {
select when twilio sendSMS
every {
twilio:sendSMS(event:attrs{"from"},
event:attrs{"to"},
event:attrs{"message"}) setting (resp)
send_directive("resp", {"resp": resp})
}
}
rule messages {
select when twilio messages
pre {
resp = twilio:messages(event:attrs{"from"},
event:attrs{"to"},
event:attrs{"pageSize"})
}
send_directive("resp", {"resp": resp})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment