Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
themeConfluence
languagejavascript
append("#foo", "<p>This is the text</p>")send_directive('text') with body = "Hello World"

The following ruleset shows append() being used

Code Block
themeConfluence
languagejavascript
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:

...