Skip to content

Instantly share code, notes, and snippets.

@hawx
Created March 31, 2014 09:39
Show Gist options
  • Save hawx/9888823 to your computer and use it in GitHub Desktop.
Save hawx/9888823 to your computer and use it in GitHub Desktop.
send
#!/usr/bin/env sh
#
# Usage: send <username> <password> <accountReference> <recipient> < file
# eg. send [email protected] secretPassword EX00000 44132133113213 < mymessage.txt
body=$(cat)
curl -X POST --user "$1:$2" -d@- "https://api.esendex.com/v1.0/messagedispatcher" <<EOS
<?xml version="1.0" encoding="utf-8"?>
<messages>
<accountreference>$3</accountreference>
<message>
<to>$4</to>
<body>$body</body>
</message>
</messages>
EOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment