@trycourier/cli 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -39,16 +39,33 @@ You can find your Courier API key in your [Courier Settings](https://app.courier
39
39
 
40
40
  ## Commands
41
41
 
42
- - `courier config` – Set your Courier API key in `~/.courier`
42
+ - `courier config` – Set your Courier API key
43
43
  - `courier whoami` – Display the currently authenticated workspace
44
44
  - `courier send` - Send a notification to a user, list, or audience
45
- - `courier track` - Send an event to test your Courier Automations
46
- - `courier digests:flush` - Send an event to test your Courier Automations
45
+ - `courier track` - Send a track event to trigger a Courier Automations
46
+ - `courier digests:flush` – Flush any currently queued events for a given user + digest
47
47
  - `courier translations:upload` - Upload .PO files to your Courier workspace
48
48
  - `courier translations:download` - Download .PO files from your Courier workspace
49
49
 
50
50
  For more details, run `courier` to see a list of commands and their arguments & options.
51
51
 
52
+ ## Examples
53
+
54
+ ```
55
+ $ courier send --tel 555-867-5309 --body "Hey Jenny\\!"
56
+ $ courier send --user user123 --template my-template-id --foo bar
57
+ $ courier send --email user@example.com --title "My Subject" --body "My Body"
58
+ $ courier send --user user123 --title "Important\\!" --body "Lorem Ipsum" --channels sms,push
59
+ $ courier send --user user123 --elemental my-template.json --foo bar
60
+
61
+ $ courier track my-event user123 --foo bar
62
+
63
+ $ courier digests:flush user123 my-digest-id
64
+
65
+ $ courier translations:upload en-US ./translations/en-US.po
66
+ $ courier translations:download en-US --text > example.en-US.po
67
+ ```
68
+
52
69
  ## License
53
70
 
54
71
  [MIT License](http://www.opensource.org/licenses/mit-license.php)
@@ -91,7 +91,7 @@ export default ({ params }) => {
91
91
  return (React.createElement(UhOh, { text: "You must specify a message body, template, or Elemental file path." }));
92
92
  }
93
93
  let payload = constructPayload(params);
94
- if (!payload.message.to) {
94
+ if (Array.isArray(payload.message.to) && !payload.message.to.length) {
95
95
  return React.createElement(UhOh, { text: "You must specify a recipient." });
96
96
  }
97
97
  if (payload.type === 'elemental' &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/cli",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "courier": "dist/cli.js"