-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: Support Slack for sending notifications
- Loading branch information
1 parent
e6c2b42
commit 92fe641
Showing
4 changed files
with
172 additions
and
38 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
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 |
---|---|---|
@@ -1,9 +1,20 @@ | ||
CodeQ: | ||
PublishNotifier: | ||
senderName: 'Neos' | ||
senderAddress: '[email protected]' | ||
notifyEmails: [] | ||
subject: '%1$s has published changes' | ||
body: |+ | ||
%1$s has published changes to the private workspace %2$s. | ||
Please review the changes and publish to live: %3$s' | ||
email: | ||
enabled: false | ||
senderName: 'Neos' | ||
senderAddress: '[email protected]' | ||
notifyEmails: [] | ||
subject: '%1$s has published changes' | ||
body: |+ | ||
%1$s has published changes to the private workspace %2$s. | ||
Please review the changes and publish to live: %3$s' | ||
slack: | ||
enabled: false | ||
postTo: [] | ||
#example: | ||
# webhookUrl: 'https://hooks.slack.com/services/...' | ||
# clientSettings: [] # additional client configurations | ||
message: |+ | ||
%1$s has published changes to the private workspace %2$s. | ||
Please review the changes and publish to live: %3$s' |
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 |
---|---|---|
@@ -1,16 +1,61 @@ | ||
# Neos - Publisher Notifier | ||
# Neos CMS - Publisher Notifier | ||
|
||
This package sends notifications to admins every time someone publishes to an internal workspace. | ||
This package sends notifications every time someone publishes to an internal workspace. If the internal workspace | ||
already has unpublished changes it will not send notifications anymore to not spam slack channels or email inboxes. | ||
|
||
## Usage | ||
Simply install the package via composer: | ||
|
||
```bash | ||
composer require codeq/publishnotifier | ||
``` | ||
|
||
Make sure your site has `Neos.Flow.http.baseUri` setting set, so your reviewers would get correct urls. | ||
|
||
## Configuration for email notifications | ||
|
||
In order to send messages to emails you need to add configure the [neos/swiftmailer](https://swiftmailer-for-flow.readthedocs.io/en/latest/) credentials | ||
|
||
Then you need to configure the target email addresses, together with the email content: | ||
|
||
```yaml | ||
CodeQ: | ||
PublishNotifier: | ||
email: | ||
enabled: false | ||
senderName: 'Neos' | ||
senderAddress: '[email protected]' | ||
notifyEmails: | ||
- '[email protected]' | ||
subject: '%1$s has published changes' | ||
body: |+ | ||
%1$s has published changes to the private workspace %2$s. | ||
Please review the changes and publish to live: %3$s' | ||
``` | ||
## Configuration for slack messages | ||
In order to send messages to Slack you need to add an incoming WebHook to your Slack workspace. Read more about it here [https://api.slack.com/incoming-webhooks](https://api.slack.com/incoming-webhooks) | ||
As the incoming webhooks are treated as Slack Apps they are bound to a single channel. Therefore you can configure multiple "postTo" to use several webhooks: | ||
```yaml | ||
CodeQ: | ||
PublishNotifier: | ||
slack: | ||
enabled: false | ||
postTo: [] | ||
myExampleTarget: | ||
webhookUrl: 'https://hooks.slack.com/services/...' | ||
clientSettings: [] # additional client configurations | ||
message: |+ | ||
%1$s has published changes to the private workspace %2$s. | ||
Please review the changes and publish to live: %3$s' | ||
``` | ||
Read more about the possible client settings and options here: https://github.com/maknz/slack#settings | ||
1. Install the package: `composer require codeq/publishnotifier` | ||
2. Setup SwiftMailer SMTP credentials if you haven't already. | ||
3. Adjust the settings. See Settings.yaml file for all configuration settings. | ||
4. Make sure your site has `Neos.Flow.http.baseUri` setting set, so your reviewers would get correct urls. | ||
## Possible Improvements | ||
- Implement throttling | ||
- Automatically get email addresses from all live-publishers. | ||
- Show visual diff of changes |
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