[WordPress] 外掛分享: Notification for Telegram

WordPress 外掛 Notification for Telegram 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Notification for Telegram」是 2020-09-16 上架。
  • 目前有 4000 個安裝啟用數。
  • 上一次更新是 2025-01-28,距離現在已有 95 天。
  • 外掛最低要求 WordPress 4.0 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
  • 有 62 人給過評分。
  • 論壇上目前有 1 個提問,問題解答率 0%

外掛協作開發者

rainafarai |

外掛標籤

telegram | mailchimp | woocommerce | contact form |

內容簡介

推送 Telegram 消息通知:
* 當在 WooCommerce 收到新訂單時。
* 當 WooCommerce 訂單更改狀態時。
* 在 WooCommerce 結帳頁面上新增一個字段,讓客戶添加自己的 Telegram 呢稱。
* 在產品庫存條件不足時發出庫存不足產品通知。
* 在管理員訂單詳細資料頁面顯示 Telegram 呢稱連結(當存在時)。
* 當收到新表單時(支援 WPForm、CF7 和 Ninjaform)。
* 當新用戶訂閱或取消訂閱 Mailchimp 時。
* 當新用戶註冊時。
* 當用戶登錄失敗時。
* 當有人將產品添加到 WooCommerce 購物車中時。
* 當收到新未發布文章時(適用於任何文章類型)。
* 語音功能,可讓機器人向人們發出語音訊息。
* Cron 作業檢測並通知插件和核心更新時。
* 在 WordPress 的任何地方使用簡碼發送自訂訊息。
* 應該在多站點上運作。

您可以在外掛設置頁面啟用/停用每個通知。

要配置該插件,您需要一個有效的 Telegram API 令牌。輕鬆地開始創建 Telegram 機器人即可獲取其令牌。
您可以在此文件
中了解有關獲取令牌和生成新令牌的知識,或按此處中的信息操作。

您還需要至少一個“chatid”號碼,該號碼是消息接收者。要知道您的個人聊天 ID 號碼,請在 Telegram 應用程序中搜索“@get_id_bot”或按此處OR另一個機器人單擊此處。

完成上述兩步驟後,保存配置並嘗試使用“TEST”按鈕。您應該會在 Telegram 中收到一條消息:“哇,它運作了!” 如果沒有,再次檢查令牌和 chatid 項是否填寫正確。

此插件依賴於第三方服務來獲取 IP 地址https://ip-api.com/的地理位置。
https://ip-api.com/docs/legal以查看該服務的使用條款和/或隱私政策

簡碼示例

[telegram_mess message="我太高興了" chatids="0000000," token="000000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" showsitename="1" showip="1" showcity="1" ]

簡碼選項:

message:您要發送的訊息。例如(message=”hello world”)

chatids:以逗號分隔的接收者,他們將收到您的訊息(例如 chatids=”0000000,11111111″)。如果為空,簡碼將在外掛選項頁面中使用預設值。

token:令牌看起來像123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
如果為空,簡碼將在外掛選項頁面中使用預設值。

showsitename:如果設置為“1”,則在訊息之後添加網站名稱。預設值為“0”。例如(showsitename=”1″)

showip:如果設置為“1”,則在訊息之後添加用戶 IP 地址。默認值為“0”。例如(showip=”1″)

showcity:如果設置為“1”,則在訊息之後添加用戶城市名稱。預設值為“0”。例如(showcity=”1″)

使用簡碼

原文外掛簡介

The “Notification for Telegram” plugin for WordPress is a tool that allows you to send notifications and messages to a Telegram channel, group or user/s when specific events occur on your WordPress site.
This plugin is useful for monitoring critical events on your site, such as new comments, new user registrations, publishing activities, New forms sent, Woocommerce orders, cart and lowstock, Mailchimp and more, by sending notifications directly to a Telegram channel or group or user/s of your choice. It also offers a shortcode to send Telegram notifications on every page of your website or in your code.
Receive Telegram messages notification when:

When receive a new order in Woocommerce.
When a Woocommerce order change status.
New field in Woocommerce checkout page let customers add the own telegram nickname
Low Stock Product notifications when a product is low stock conditions.
Shows Telegram Nick link in admin order details page when present
When receive new forms (supports Elementor Pro Form, WPForm , CF7 and Ninjaform)
When new user subscribes or unsubscribes to mailchimp. MC4WP integration
When new user registers.
When users login or fail login.
When new comment is posted.
When someone adds or remove a product in the Woocommerce cart.
When a new Pending posts is received. (works with any post type)
Say function to speak to make the bot say Something to the people
Cron job detect and notify when Plugins & Core need to update.
Send custom message with Shortcode anywhere in your WP.
Should Work on Multisite

You can enable/disable every notification in the Plugin settings page.
To configure the plugin, you need a valid Telegram API token. Its easy to get starting a Telegram Bot.
You can learn about obtaining tokens and generating new ones in
this document
or follow the info in this post
You also need at least one “chatid” number, that is the recipient to the message will be send. To know you personal chatid number, search on telegram app for “@get_id_bot” or
click here OR another bot @RawDataBot click here
Once You got the 2 fields save the configuration and try the “TEST” button .. you should receive a message in you telegram : “WOW IT WORKS” !! If not, check token and chatid fields again for the correct values.
this plugin is relying on a 3rd party service to geolocate the Ip address https://ip-api.com/
https://ip-api.com/docs/legal to see the services’ a terms of use and/or privacy policies
SHORTCODE EXAMPLE
[telegram_mess message="Im so happy" chatids="0000000," token="000000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" showsitename="1" showip="1" showcity="1" ]

SHORTCODE OPTIONS:

message : Your message to be sent. Example (message=”hello world”)

chatids : Recipient(s) who will receive your message separated by comma (example chatids=”0000000,11111111″) , If not present this field the shortcode will use default value in Plugin option page.

token: The token looks something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
If not present this field, the shortcode will use default value in Plugin option page.

showsitename: if set to “1” appends sitename after the message. Defaultvalue is “0” Example (showsitename=”1″)

showip: if set to “1” appends user ip address after the message. Default value is “0” Example (showip=”1″)

showcity: if set to “1” appends user city name after the message. Default value is “0” Example (showcity=”1″)

USE SHORTCODE IN YOU PHP CODE

** WOOCOMERCE FILTER HOOKS **
We have created 4 filter hooks for WooCommerce order notification message. 4 new positions: Message Header, Message Footer, before Items, and after Items. And we have created a filter through which you can add custom code to product rows, and if you want, you can replace and customize the entire row. :
4 new Positions and code axample ( echo payment_status in the 4 positions)
get_data();

// Extract specific order information

$payment_status = $order->get_status();
$payment_method = $order->get_payment_method();
}
return "\r\n\r\n".$payment_method."(".$payment_status.")\r\n" ;
}
?>

Product rows Filter with 2 different behaviors ADD or REPLACE LINE
".$product_id. "\r\n";

// REPLACE Product ITEM LINE CODE WITH YOUR CODE without concatenate $message.
$modified_data = $product_id. "\r\n";

return $modified_data;
}
?>

** USER LOGIN HOOKS **
user_registered;
$timestamp = strtotime($registration_date);
$locale = 'it_IT'; // Italian locale

$formatter = new IntlDateFormatter($locale, IntlDateFormatter::LONG, IntlDateFormatter::LONG, 'UTC');
$formatter->setPattern('d MMMM y HH:mm:ss');

$formatted_date = $formatter->format($timestamp);
$message = "\r\n\r\nUser gistration Date: " . $formatted_date."\r\n\r\n";
} else {

$message = "\r\n No info about user ! \r\n " ;

}

return $message;
}
?>

before the hooks we introduced 3 function so you can add things in message without changing the plug code
We keep them for compatibility but encourage the use of hooks!!
Position in the order message are: before items, after items, product_line
1) before the product list : (add order ID example)

2) after the product list: (add order Currency example)
get_data(); // order data
return "Currency: ".$data['currency'];
} ?php>

3) at the end of the line of each individual product of the order: (add product slug example)
get_slug()." ";
} ?php>

Suggestions for other Notification, hooks and others plug integrations are Welcome !!

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Notification for Telegram」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


2.7 | 2.8 | 2.9 | 3.3 | 3.4 | 3.3.2 | 3.3.3 | 3.3.6 | 3.3.7 | trunk |

延伸相關外掛(你可能也想知道)

  • MC4WP: Mailchimp for WordPress 》讓訪客訂閱您的電子報應該很容易。透過這款外掛,現在終於可以輕鬆做到了。 這個外掛可幫助您在 Mailchimp 中擴展您的電子郵件列表。您可以使用它來創建外觀...。
  • Mailchimp for WooCommerce 》加入 Mailchimp 的 1,700 萬客戶,這是全球最大的行銷自動化平台,以發展您的電子商務行銷策略。藉由官方 Mailchimp for WooCommerce 整合,您的客戶及其購買...。
  • Easy Forms for Mailchimp 》Easy Forms for Mailchimp 是一款 WordPress 外掛,可以讓你在網站中加入無限量的 Mailchimp 註冊表單。你可以在文章、頁面、側邊欄和其他採用小工具區域中加...。
  • Contact Form 7 Extension For Mailchimp 》WordPress Extension for Mailchimp (Chimpmatic Lite)可將Contact Form 7與Mailchimp Audience集成。使用Mailchimp的最新API自動將Contact Form 7提交的信息...。
  • Mailchimp List Subscribe Form 》使用 MailChimp List Subscribe 外掛快速在 WordPress 2.8 及以上版本的網站上新增 MailChimp 訂閱表單小工具。, 安裝後,您可以使用 API 金鑰登入,選擇您的...。
  • Genesis eNews Extended 》此外掛提供一個新的小工具,讓 Genesis 網站輕鬆添加郵件列表。在幾乎所有 Genesis 主題的教學中,這是推薦的掛件。此小工具允許站點管理員設置 Feedburner I...。
  • Popup, Optin Form & Email Newsletters for Mailchimp, HubSpot, AWeber – MailOptin 》建立彈出視窗和訂閱表單,使用我們直覺式的彈出視窗建立外掛程式來獲取更多電子報訂閱者、銷售機會和潛在客戶!🚀, MailOptin 是一個表單建立器和彈出視窗製...。
  • MailChimp Forms by MailMunch 》將您的網站訪客轉換為電子郵件訂閱者最簡單的方法。, 只需點擊幾下,即可向您的網站、部落格或電子商務店添加無限量的美麗 Mailchimp 訂閱表單。MailMunch 的...。
  • Featured Images in RSS for Mailchimp & More 》即時免費獲取您的 RSS 訂閱中的圖像。將博客精選圖片輸出到 Mailchimp RSS 電子郵件活動、ActiveCampaign、Infusionsoft、Hubspot、Zoho、Feedburner、Bloglo...。
  • Newsletter Sign-Up 》訂閱電子報, , 此外掛現處於維護模式,我們不再開發新功能或提供支援。抱歉。, , 此外掛會在您的 WordPress 網站上新增各種訂閱方式,例如在留言表單中加入訂...。
  • MC4WP: Mailchimp Top Bar 》此外掛會在你的 WordPress 網站頂端添加一個美麗、可自訂的註冊條。這條條幾乎可以保證吸引到所有網站訪客,並且增加你的 Mailchimp 訂閱者數量。, , 此外掛...。
  • Integration for Mailchimp and Contact Form 7, WPForms, Elementor, Ninja Forms 》Contact Form 7 Mailchimp 擴充功能會在任何人提交表單時,將來自Contact Form 7、Contact Form Entries 和許多流行聯絡表單外掛程式的表單提交傳送至 Mailch...。
  • WP WooCommerce Mailchimp 》WP WooCommerce Mailchimp 為 WooCommerce 提供簡單靈活且可調整的 Mailchimp 整合外掛。, 當客戶下單或完成訂單時,自動訂閱客戶到指定的 Mailchimp 清單,...。
  • wpMandrill 》這個外掛程式使用Mandrill API從你的WordPress安裝中發送出站電子郵件,可包含附件或不包含,並取代了WordPress附帶的wp_mail功能。, 寄出的電子郵件將由Mand...。
  • Send Emails with Mandrill 》您覺得這個外掛程式有幫助嗎?請考慮給予五星評價。, 注意:這是一個分支版本的現已停止支援 wpMandrill 外掛程式。下面的註記已經從原始外掛程式複製過來,...。

文章
Filter
Apply Filters
Mastodon