Created
April 4, 2011 18:47
-
-
Save snay2/902158 to your computer and use it in GitHub Desktop.
Example for using the Postmark API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": "[email protected]" | |
} | |
use module a163x74 alias postmark with postmarkkeys = keys:postmark() | |
} | |
dispatch {} | |
global {} | |
rule send_message { | |
select when pageview ".*" | |
{ | |
postmark:send_email() with to = "[email protected]" | |
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