Skip to content

Instantly share code, notes, and snippets.

@rsbohn
Created March 1, 2012 21:06
Show Gist options
  • Save rsbohn/1953234 to your computer and use it in GitHub Desktop.
Save rsbohn/1953234 to your computer and use it in GitHub Desktop.
Catch email from cloudmailin.com
// handle email from cloudmailin.com
// Set up an email address on cloudmailin.com
// Set the webhook URL to:
// http://cs.kobj.net/sky/event/:your_kynetx_token/:endpoint_id/email/recv
// (fill in :your_kynetx_token and :endpoint_id)
//
// Save these rules in a ruleset, then subscribe to the ruleset
// To test:
// Use the Kynetx Event Console, raise an event with domain=email and type=recv
// (This stores the event attributes in ent:postbox.)
// Then raise domain=cloudmi type=fetch.
// You should see the event attributes from ent:postbox in the response.
rule rcv_email {
select when email recv
noop();
fired {
set ent:postbox event:attrs();
}
}
rule peek {
select when cloudmi fetch
pre {
stored_attributes = ent:postbox || "Empty";
}
send_directive("peek") with postbox = stored_attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment