{"action":"created","issue":{"url":"https://api.github.com/repos/mailgun/mailgun-go/issues/69","repository_url":"https://api.github.com/repos/mailgun/mailgun-go","labels_url":"https://api.github.com/repos/mailgun/mailgun-go/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/mailgun/mailgun-go/issues/69/comments","events_url":"https://api.github.com/repos/mailgun/mailgun-go/issues/69/events","html_url":"https://github.com/mailgun/mailgun-go/pull/69","id":189454008,"number":69,"title":"Added mailgun cli","user":{"login":"thrawn01","id":9817,"avatar_url":"https://avatars.githubusercontent.com/u/9817?v=3","gravatar_id":"","url":"https://api.github.com/users/thrawn01","html_url":"https://github.com/thrawn01","followers_url":"https://api.github.com/users/thrawn01/followers","following_url":"https://api.github.com/users/thrawn01/following{/other_user}","gists_url":"https://api.github.com/users/thrawn01/gists{/gist_id}","starred_url":"https://api.github.com/users/thrawn01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thrawn01/subscriptions","organizations_url":"https://api.github.com/users/thrawn01/orgs","repos_url":"https://api.github.com/users/thrawn01/repos","events_url":"https://api.github.com/users/thrawn01/events{/privacy}","received_events_url":"https://api.github.com/users/thrawn01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-15T17:22:12Z","updated_at":"2016-11-15T22:19:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mailgun/mailgun-go/pulls/69","html_url":"https://github.com/mailgun/mailgun-go/pull/69","diff_url":"https://github.com/mailgun/mailgun-go/pull/69.diff","patch_url":"https://github.com/mailgun/mailgun-go/pull/69.patch"},"body":"# Purpose\r\nProvide a simple Mailgun cli for interacting with the Mailgun api. \r\n\r\nProvided\r\n```bash\r\n$ export MG_DOMAIN=my-domain.com\r\n$ export MG_API_KEY=your-api-key\r\n$ export MG_PUBLIC_API_KEY=your-public-api-key\r\n```\r\nThis\r\n```bash\r\n$ mailgun send --lorem --count 10 thrawn01@gmail.com derrick@mailgun.com\r\n```\r\nIs much simpler than\r\n```bash\r\nfor $i in {1..10}; then\r\ncurl -s --user 'api:${MG_API_KEY}' \\\r\n    https://api.mailgun.net/v3/${MG_DOMAIN}/messages \\\r\n    -F from='Excited User <user@localhost>' \\\r\n    -F to=derrick@mailgun.com \\\r\n    -F to=thrawn01@gmail.com \\\r\n    -F subject='Hello ${i}' \\\r\n    -F text='Testing some Mailgun awesomness!'\r\nfi\r\n```\r\nMaking a brew formula for this cli would also be pretty simple. Then users could\r\n```bash\r\n$ brew install mailgun-cli\r\n```\r\n\r\n# Implementation\r\nInitial release provides a cli with a single sub command called 'send' which initially provides simple sending with tags.\r\n\r\n### Mailgun Help\r\n```\r\nUsage:  [OPTIONS]\r\n\r\nCLI for mailgun api\r\n\r\nExamples:\r\n   Set your credentials in the environment\r\n   export MG_DOMAIN=your-domain-name\r\n   export MG_API_KEY=your-api-key\r\n   export MG_PUBLIC_API_KEY=your-public-api-key\r\n\r\n   Post a simple event message from stdin\r\n   $ echo -n 'Hello World' | mailgun send -s \"Test subject\" address@example.com\r\n\r\n Help:\r\n   For detailed help on send\r\n   $ mailgun send -h\r\n\r\nCommands:\r\n  send\r\n\r\nOptions:\r\n  -v, --verbose          be verbose\r\n  -u, --url              url to the mailgun api (Default=https://api.mailgun.net/v3, Env=MG_URL)\r\n  -a, --api-key          mailgun api key (Env=MG_API_KEY)\r\n  -p, --public-api-key   mailgun public api key (Env=MG_PUBLIC_API_KEY)\r\n  -d, --domain           mailgun api key (Env=MG_DOMAIN)\r\n  -h, --help             Display this help message and exit\r\n```\r\n\r\n### Mailgun send help\r\n```\r\nUsage:  [OPTIONS]  <addresses>\r\n\r\nSend emails via the mailgun HTTP API\r\n\r\nExamples:\r\n   Post a simple email from stdin\r\n   $ echo -n 'Hello World' | mailgun send -s \"Test subject\" address@example.com\r\n\r\n   Post a simple email to a specific domain\r\n   $ echo -n 'Hello World' | mailgun send -s \"Test subject\" address@example.com -d my-domain.com\r\n\r\n   Post a test lorem ipsum email (random content, and subject)\r\n   $ mailgun send --lorem address@example.com\r\n\r\n   Post a 10 random test lorem ipsum emails\r\n   $ mailgun send --lorem address@example.com --count 10\r\n\r\nArguments:\r\n  addresses   a list of email addresses\r\n\r\nOptions:\r\n  -v, --verbose          be verbose\r\n  -u, --url              url to the mailgun api (Default=https://api.mailgun.net/v3, Env=MG_URL)\r\n  -a, --api-key          mailgun api key (Env=MG_API_KEY)\r\n  -p, --public-api-key   mailgun public api key (Env=MG_PUBLIC_API_KEY)\r\n  -d, --domain           mailgun api key (Env=MG_DOMAIN)\r\n  -h, --help             Display this help message and exit\r\n  -s, --subject          subject of the message\r\n  -t, --tags             comma separated list of tags\r\n  -f, --from             from address, defaults to <user>@<hostname> (Env=MG_FROM)\r\n  -l, --lorem            generate a randome subject and message content\r\n  -c, --count            send the email x number of counts (Default=1)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/mailgun/mailgun-go/issues/comments/260788512","html_url":"https://github.com/mailgun/mailgun-go/pull/69#issuecomment-260788512","issue_url":"https://api.github.com/repos/mailgun/mailgun-go/issues/69","id":260788512,"user":{"login":"pirogoeth","id":472488,"avatar_url":"https://avatars.githubusercontent.com/u/472488?v=3","gravatar_id":"","url":"https://api.github.com/users/pirogoeth","html_url":"https://github.com/pirogoeth","followers_url":"https://api.github.com/users/pirogoeth/followers","following_url":"https://api.github.com/users/pirogoeth/following{/other_user}","gists_url":"https://api.github.com/users/pirogoeth/gists{/gist_id}","starred_url":"https://api.github.com/users/pirogoeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pirogoeth/subscriptions","organizations_url":"https://api.github.com/users/pirogoeth/orgs","repos_url":"https://api.github.com/users/pirogoeth/repos","events_url":"https://api.github.com/users/pirogoeth/events{/privacy}","received_events_url":"https://api.github.com/users/pirogoeth/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T22:19:20Z","updated_at":"2016-11-15T22:19:20Z","body":"@mbanzon can you review @thrawn01's PR when you get a chance?"}}
{"actor":{"display_login":"pirogoeth"}}