| 1 | # Send |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | The `send` command delivers a notification using one or more specified service URLs. |
| 6 | |
| 7 | ## Usage |
| 8 | |
| 9 | ```bash title="Send Command Syntax" |
| 10 | shoutrrr send [FLAGS] |
| 11 | ``` |
| 12 | |
| 13 | | Flag | Description | |
| 14 | |-------------------------|---------------------------------------------------------------------------| |
| 15 | | `-h, --help` | Displays help for the `send` command. | |
| 16 | | `-m, --message string` | Specifies the message to send. Use `-` to read the message from stdin. | |
| 17 | | `-t, --title string` | Sets the title for services that support it (optional). | |
| 18 | | `-u, --url stringArray` | Specifies the notification service URL(s). Multiple URLs can be provided. | |
| 19 | | `-v, --verbose` | Enables verbose output, logging URLs, message, and title to stderr. | |
| 20 | |
| 21 | !!! Note |
| 22 | The `--url` and `--message` flags are required. Use `--message -` to read the message from stdin. Duplicate URLs are automatically removed. |
| 23 | |
| 24 | ### URL |
| 25 | |
| 26 | - Supports multiple service URLs, deduplicated before sending. URLs are parsed and services initialized accordingly. |
| 27 | |
| 28 | ### Message |
| 29 | |
| 30 | - The message body. If set to `-`, reads from stdin and logs the byte count read. |
| 31 | |
| 32 | ### Title |
| 33 | |
| 34 | - Optional title passed to services that support it. |
| 35 | |
| 36 | ### Verbose |
| 37 | |
| 38 | - Enables detailed logging: lists URLs (with indentation for multiples), truncated message (up to 100 characters with ellipsis), title if provided, and "Notification sent" upon success. |
| 39 | |
| 40 | ## Examples |
| 41 | |
| 42 | <!-- markdownlint-disable --> |
| 43 | ### Send a Notification to a Single Service URL |
| 44 | |
| 45 | !!! Example |
| 46 | ```bash title="Send Command with Discord URL" |
| 47 | shoutrrr send --url "discord://abc123@123456789" --message "Hello, Discord!" |
| 48 | ``` |
| 49 | |
| 50 | ```text title="Expected Output" |
| 51 | Notification sent |
| 52 | ``` |
| 53 | |
| 54 | ### Send a Notification with a Title |
| 55 | |
| 56 | !!! Example |
| 57 | ```bash title="Send Command with Title" |
| 58 | shoutrrr send --url "discord://abc123@123456789" --message "Hello, Discord!" --title "Test Notification" |
| 59 | ``` |
| 60 | |
| 61 | ```text title="Expected Output" |
| 62 | Notification sent |
| 63 | ``` |
| 64 | |
| 65 | ### Send a Notification with Verbose Output |
| 66 | |
| 67 | !!! Example |
| 68 | ```bash title="Send Command with Verbose Output" |
| 69 | shoutrrr send --url "discord://abc123@123456789" --message "Hello, Discord!" --verbose |
| 70 | ``` |
| 71 | |
| 72 | ```text title="Expected Output" |
| 73 | URLs: discord://abc123@123456789 |
| 74 | Message: Hello, Discord! |
| 75 | Notification sent |
| 76 | ``` |
| 77 | |
| 78 | ### Send a Notification with Message from Stdin |
| 79 | |
| 80 | !!! Example |
| 81 | ```bash title="Send Command with Stdin Input" |
| 82 | echo "Hello from stdin!" | shoutrrr send --url "discord://abc123@123456789" --message - |
| 83 | ``` |
| 84 | |
| 85 | ```text title="Expected Output" |
| 86 | Reading from STDIN... |
| 87 | Read 18 byte(s) |
| 88 | Notification sent |
| 89 | ``` |
| 90 | |
| 91 | ### Send to Multiple URLs with Deduplication |
| 92 | |
| 93 | !!! Example |
| 94 | ```bash title="Send Command with Multiple URLs" |
| 95 | shoutrrr send --url "discord://abc123@123456789" --url "discord://abc123@123456789" --message "Hello!" |
| 96 | ``` |
| 97 | |
| 98 | ```text title="Expected Output" |
| 99 | Notification sent |
| 100 | ``` |
| 101 | |
| 102 | ### Send with Verbose and Multiple URLs |
| 103 | |
| 104 | !!! Example |
| 105 | ```bash title="Send Command with Verbose and Multiple URLs" |
| 106 | shoutrrr send --url "discord://abc123@123456789" --url "slack://token@team/channel" --message "Hello!" --verbose |
| 107 | ``` |
| 108 | |
| 109 | ```text title="Expected Output" |
| 110 | URLs: discord://abc123@123456789 |
| 111 | slack://token@team/channel |
| 112 | Message: Hello! |
| 113 | Notification sent |
| 114 | Notification sent |
| 115 | ``` |
| 116 | <!-- markdownlint-restore --> |