Created
March 31, 2014 09:39
-
-
Save hawx/9888823 to your computer and use it in GitHub Desktop.
send
This file contains hidden or 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
#!/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