Skip to content

Instantly share code, notes, and snippets.

@snay2
Created April 4, 2011 18:47
Show Gist options
  • Save snay2/902158 to your computer and use it in GitHub Desktop.
Save snay2/902158 to your computer and use it in GitHub Desktop.
Example for using the Postmark API
ruleset a163x75 {
meta {
name "Postmark example"
description <<
Uses the Postmark module to send an email when called through a bookmarklet
>>
author "Steve Nay"
logging off
key postmark {
"key": "--redacted--",
"sender": "steve@scnay.com"
}
use module a163x74 alias postmark with postmarkkeys = keys:postmark()
}
dispatch {}
global {}
rule send_message {
select when pageview ".*"
{
postmark:send_email() with to = "steven.nay@gmail.com"
and subject = "Testing from KRL with module from separate app"
and htmlbody = "<p>This is a test message sent from the Postmark KRL module</p>";
notify("Postmark", "Email sent successfully (?)");
}
}
rule result {
select when http post label "postmark_send"
pre {
content_type = event:param("content_type");
content_length = event:param("content_length");
content = event:param("content");
status_line = event:param("status_line");
status_code = event:param("status_code");
}
notify("Result was...", content) with sticky=true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment