...
Code Block | ||||
---|---|---|---|---|
| ||||
append("#foo", "<p>This is the text</p>")send_directive('text') with body = "Hello World" |
The following ruleset shows append() being used
Code Block | ||||
---|---|---|---|---|
| ||||
ruleset a1299x164a1299x188 { meta { name "AppendSend Directive Example" author "nathan cerny" logging offon } dispatch { // domain "exampley.com" } rule appendpage_example_ruleview { select when usingpageview ".*" pre { resp = http:get('http://webhooks.kynetxapps.net/h/a1299x188.dev/directive_example'); content = resp.pick('$..content'); append("#append", "<span style=\"color:red;\">| You fired the after rule </span>"); } append('body', '<h1>Directive Response: </h1>' + content); } rule directive_example { select when webhook directive_example send_directive("text") with body = "my text response"; } } |
The following demonstrates the preceding rule:
...