forked from 2600hz/kazoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KAZOO-4539: Customers update over teletype
- Loading branch information
Showing
5 changed files
with
382 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,3 +298,99 @@ All accounts will continue to be processed by the `notify` app until the Crossba | |
``` | ||
curl -H 'X-Auth-Token: {AUTH_TOKEN}' -H 'Content-Type: text/plain' http://server:8000/v2/accounts/{ACCOUNT_ID}/notifications/smtplog | ||
``` | ||
|
||
## Customer update | ||
|
||
* POST - Send a message to all reseller's children or to a particular account. | ||
|
||
Send message to all reseller's accounts: | ||
``` | ||
curl -X POST -H 'X-Auth-Token: {AUTH_TOKEN}' -H 'Content-Type: text/plain' http://server:8000/v2/notifications/customer_update/send_message -d '{}' | ||
curl -X POST -H 'X-Auth-Token: {AUTH_TOKEN}' -H 'Content-Type: text/plain' http://server:8000/v2/accounts/{SENDER(RESELLER)_ACCOUNT_ID}/notifications/customer_update/send_message -d '{}' | ||
``` | ||
|
||
Send message to a particular acount: | ||
``` | ||
curl -X POST -H 'X-Auth-Token: {AUTH_TOKEN}' -H 'Content-Type: text/plain' http://server:8000/v2/notifications/customer_update/send_message/{RECIPIENT_ACCOUNT_ID} -d '{}' | ||
curl -X POST -H 'X-Auth-Token: {AUTH_TOKEN}' -H 'Content-Type: text/plain' http://server:8000/v2/accounts/{SENDER(RESELLER)_ACCOUNT_ID}/notifications/customer_update/send_message/{RECIPIENT_ACCOUNT_ID} -d '{}' | ||
``` | ||
|
||
You can send a message to all users, admins only or a particular user within an account: | ||
|
||
All users: | ||
``` | ||
"user_type": "all_users" | ||
```` | ||
Particular user: | ||
``` | ||
"user_type": "{ACCOUNT_ID}" | ||
```` | ||
Admin privileged users only. Default. Could be omitted: | ||
``` | ||
"user_type": "admins_only" | ||
```` | ||
|
||
You can send a message with changed subject, html and plain text templates by providing full notification document payload: | ||
|
||
``` | ||
{ | ||
"data": { | ||
"user_type": "3d9b564d5c95d52d81a2e49ea0c57941" | ||
"id": "customer_update", | ||
"account_overridden": true, | ||
"enabled": true, | ||
"category": "user", | ||
"friendly_name": "Customer update", | ||
"from": "[email protected]", | ||
"subject": "Test Reseller customer update", | ||
"bcc": { | ||
"email_addresses": [], | ||
"type": "" | ||
}, | ||
"cc": { | ||
"email_addresses": [], | ||
"type": "" | ||
}, | ||
"macros": { | ||
"user.email": { | ||
"description": "Email of the user", | ||
"friendly_name": "Email", | ||
"i18n_label": "user_email" | ||
}, | ||
"user.first_name": { | ||
"description": "First Name", | ||
"friendly_name": "First Name", | ||
"i18n_label": "first_name" | ||
}, | ||
"user.last_name": { | ||
"description": "Last Name", | ||
"friendly_name": "Last Name", | ||
"i18n_label": "last_name" | ||
}, | ||
"user.timezone": { | ||
"description": "Timezone of the user", | ||
"friendly_name": "Timezone", | ||
"i18n_label": "user_timezone" | ||
}, | ||
"user.username": { | ||
"description": "Username", | ||
"friendly_name": "Username", | ||
"i18n_label": "username" | ||
} | ||
}, | ||
"template_charset": "utf-8", | ||
"html": "PHA+RGVhciB7e3VzZXIuZmlyc3RfbmFtZX19IHt7dXNlci5sYXN0X25hbWV9fS48L3A+CjxwPkhlcmUgYXJlIHNvbWUgbmV3cyB0aGF0IHdlIGhhdmUgc2VsZWN0ZWQgZm9yIHlvdTwvcD4KPHA+QmVzdCByZWdhcmRzLDwvcD4KPHA+T25OZXQgSW5ub3ZhdGlvbnMgTGltaXRlZC48L3A+", | ||
"plain": "Dear {{user.first_name}} {{user.last_name}}.\n\nHere are some more news that we have selected for you.\n\nBest regards,\nOnNet Innovations Limited.", | ||
"templates": { | ||
"text/html": { | ||
"length": 161 | ||
}, | ||
"text/plain": { | ||
"length": 136 | ||
} | ||
}, | ||
} | ||
} | ||
``` |
This file contains 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
This file contains 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
Oops, something went wrong.