[WordPress] 外掛分享: External Notification

首頁外掛目錄 › External Notification
10+
安裝啟用
尚無評分
1971 天前
最後更新
問題解決
WordPress 5.4+ PHP 7.1.24+ v1.0.0 上架:2020-10-24

內容簡介

External Notification 是一個外掛,允許使用者傳送通知至 Slack。
同時,它還提供了開發者有用的鉤子(Hooks)。

預設功能

當 WordPress 傳送站台管理員的通知電子郵件時,此外掛會將訊息傳送到 Slack,取代電子郵件。
此功能可以在管理畫面中關閉。

如何使用外掛程式作為通知 API

有兩種方式可將此外掛程式用作 API。
1. 呼叫外掛程式的 ready-to-use external_notification2slack 函數
   external_notification2slack($message, $user_id, $payload)
2. 若將來的另一個外掛程式要使用此外掛程式來張貼 Slack,最好使用此選項,而不是呼叫 external_notification2slack 函數,以避免這個外掛程式在停用時引發嚴重錯誤。
   do_action( 'external_notification2slack', $message, $user_id, $payload );

針對開發者的提示
webhook_url 獲取的優先順序

在 wp-config.php 中的常數 'EXNO_SLACK_WEBHOOK_URL'
'webhook_url' 選項頁面中的輸入

記錄錯誤訊息

如果您安裝並啟用我們另一個外掛程式 'App Log',它會將錯誤訊息輸出到記錄檔。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「External Notification」→ 直接安裝(推薦)

原文外掛簡介

External Notification is a plugin that allows users to send a notification to Slack.
Also it has useful hooks for developers.
Default function
When WordPress sends a notification email for site administrators, this plugin sends the message to slack instead of an email.
This feature can be disabled from the administration screen.
How to use the plugin as a notification API
There are 2 ways to use the plugin as the API.
1. Call the ready-to-use external_notification2slack function
external_notification2slack($message, $user_id, $payload)
2. If another plugin will use this to post slack, it is best to use this option instead of calling external_notification2slack function to avoid Fatal Error in case this plugin is deactivated.\
do_action( 'external_notification2slack', $message, $user_id, $payload );
For developers
‘webhook_url’ acquisition priority

constant ‘EXNO_SLACK_WEBHOOK_URL’ in wp-config.php
‘webhook_url’ entry in External Notification option page

logging error messages
if you install & activete our another plugin ‘App Log’, outputs an error message to the log file.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon