From 108824cfdc037cfd47b82083e9b3ba20230ff09a Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Sat, 16 Dec 2017 13:30:44 +0100 Subject: [PATCH] New translations notifications.md (Chinese Traditional) --- .../translated_docs/zh-Hant/notifications.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 website/translated_docs/zh-Hant/notifications.md diff --git a/website/translated_docs/zh-Hant/notifications.md b/website/translated_docs/zh-Hant/notifications.md new file mode 100644 index 000000000..767716504 --- /dev/null +++ b/website/translated_docs/zh-Hant/notifications.md @@ -0,0 +1,53 @@ +--- +id: notifications +date: 2017-07-10T23:36:56.503Z +title: Notifications +--- +Notify was built primarily to use with Slack's Incoming webhooks, but will also deliver a simple payload to any endpoint. Currently only active for `publish` / `create` commands. + +## Usage + +An example with a **hipchat** hook: + +#### Single notification + +```yaml +notify: + method: POST + headers: [{'Content-Type': 'application/json'}] + endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken + content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}' +``` + +#### Multiple notification + +```yaml +notify: + 'example-package-1' + method: POST + headers: [{'Content-Type': 'application/json'}] + endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken + content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}' + 'example-package-2' + method: POST + headers: [{'Content-Type': 'application/json'}] + endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken + content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}' + 'example-package-3' + method: POST + headers: [{'Content-Type': 'application/json'}] + endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken + content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}' + + +``` + +## Configuration + +| Property | Type | Required | Support | Default | Description | +| -------------- | ------------ | -------- | ------- | ------- | -------------------------------------------------------------------------------------------- | +| method | string | No | all | | HTTP verb | +| packagePattern | string | No | all | | Only run this notification if the package name matches the regular expression | +| headers | array/object | Yes | all | | If this endpoint requires specific headers, set them here as an array of key: value objects. | +| endpoint | string | Yes | all | | set the URL endpoint for this call | +| content | string | Yes | all | | any Handlebar expressions | \ No newline at end of file