Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

send_directive(<type>) with options

Send a directive to the endpoint. Action modifiers are used to send directive options:

send_directive('text') with body = "Hello World"

The following ruleset shows append() being used

ruleset a1299x188 {
	meta {
		name "Send Directive Example"
		author "nathan cerny"
		logging on
	}
	dispatch {
		// domain "exampley.com"
	}
    rule page_view {
        select when pageview ".*"
        pre {
	     resp = http:get('http://webhooks.kynetxapps.net/h/a1299x188.dev/directive_example');
	     content = resp.pick('$..content');
	}
        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:

  • No labels