Notification for Telegram
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 and Surecart 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. When receive a new order in Surecart. Every event captured by WP Activity Log plugin 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. Helps identify unauthorized or suspicious registrations. 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 Setup Guide A complete step-by-step guide is available here: View the full documentation To get your Bot Token, you can refer to one of these resources: Official Telegram documentation Step-by-step guide on Medium To get your Chat ID, you need at least one recipient ID. You can retrieve it using one of these bots directly in Telegram: @get_id_bot — send /start and it will reply with your personal Chat ID @RawDataBot — send any message and it will return your full account info including your ID For Channel and Group Chatid settings see the FAQ section. 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 AI & MCP Compatible This plugin supports the WordPress Abilities API and is compatible with MCP (Model Context Protocol) — the standard that allows AI agents like Claude, ChatGPT, and others to interact with WordPress autonomously. If the Abilities API and MCP Adapter plugins are installed, any authorized AI agent can automatically discover and use the Send Telegram Message ability — no extra configuration needed. What an AI can do with this plugin: * Send a Telegram message with custom text * Add an inline button with label and URL * Override the default chat ID Requirements for MCP WordPress 7.0+ (Abilities API built-in) Plugin: MCP Adapter Enable “AI / MCP” in the plugin settings WordPress 6.9 compatibility WordPress 6.9+ Plugin: Abilities API Plugin: MCP Adapter MESSAGES TRANSLATION To translate Telegram messages, use WPML or Loco Translate. All notification strings are now translatable. Go to Loco Translate → Plugins → Notification for Telegram to add your translations. For WPML, ensure String Translation is enabled to modify notification texts. ACTION HOOK for third-party Plugin Notification for Telegram (version > 3.5.1) exposes a dedicated action hook so any third-party plugin can send messages without calling internal functions directly. Basic usage: do_action( ‘nftb_send_message’, ‘Your message here’ ); Look FAQ Section for more esamples. 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 WOOCOMMERCE 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 FILTER HOOKS user_registered; $timestamp = strtotime( $registration_date ); $formatter = new IntlDateFormatter( 'en_US', IntlDateFormatter::LONG, IntlDateFormatter::LONG, 'UTC' ); $formatter->setPattern( 'd MMMM y HH:mm:ss' ); $formatted_date = $formatter->format( $timestamp ); $message = "\r\n\r\nUser Registration Date: " . $formatted_date . "\r\n\r\n"; } else { $message = "\r\nNo info available for this user.\r\n"; } return $message; } ?> LEGACY FUNCTIONS (kept for backward compatibility) Before hooks were introduced, 3 overridable functions allowed message customization without editing plugin code. These are still supported but we encourage migrating to hooks. 1) Before the product list — example: prepend the Order ID 2) After the product list — example: append the order currency get_data(); return "Currency: " . $data['currency']; } ?> 3) At the end of each product line — example: append the product slug get_slug() . " "; } ?> Suggestions for new notifications, hooks, and plugin integrations are always welcome!
Top keywords
- message23×2.09%
- telegram18×1.63%
- product12×1.09%
- user10×0.91%
- example9×0.82%
- id9×0.82%
- send9×0.82%
- notification8×0.73%
- order8×0.73%
- code7×0.63%
- mcp7×0.63%
- shortcode7×0.63%
Rock The Slackbot
What is Slack? Slack is a team collaboration tool that offers chat rooms organized by topic, as well as private groups and direct messaging. It’s a great way to be productive with your team without clogging up your inbox. What is A Slackbot? Slackbot is Slack’s built-in robot, which helps us send messages to you and your team inside your Slack account. Why Rock The Slackbot? Because it can help you manage your websites, and stay on top of changes, by sending notifications (following numerous WordPress events) to your Slackbot who will pass them along to a channel or direct message in your Slack account. Rock the Slackbot is multisite-friendly. Rock the Slackbot sends customizable notifications for the following events: When a post is published When a post is unpublished When a post is updated When a post is deleted When a post is trashed When a comment is added When a comment is approved When a comment is unapproved When a comment is marked as spam When a comment is trashed When a 404 error is thrown When a menu item is deleted When media is added When media is edited When media is deleted When a user is added When a user is deleted When a user’s role is changed When a plugin, theme, or core update is available When a plugin, theme, or core is updated I’m working to add the following events: When menu item is added When plugins or themes are uploaded When plugins or themes are activated Each event can be customized to allow you to send different event notifications to different Slack channels, e.g. you can send core, theme and plugin updates to your “wp-development” channel while all of your post changes go to your “wp-content” channel. Please use the Issues section of this plugin’s GitHub repo to suggest features, like other notification events. A Slack account is required to use this plugin and is free to use for as long as you want and with an unlimited number of people. Visit the Slack website to learn more and sign up. Send A Simple Slack Message You can use the following send_webhook_message() function to send a simple message to your Slack account. The function accepts the following parameters: $webhook_id_or_url – provide the webhook URL or the ID of one stored in settings $message – the message you want to send $channel – OPTIONAL – the channel you want to send message to. Prefix with # for a specific channel or @ for a specific user. Will use default channel if nothing is passed. // Use this function to send a simple message to Slack rock_the_slackbot()->send_webhook_message( ‘564d3c1cdf52d’, ‘this is a test’, ‘#testchannel’ ); Filters Rock The Slackbot has filters setup to allow you to tweak each WordPress notification before it’s sent. You can setup a filter for all notifications or drill down by event or specific webhook. Each notification filter passes three arguments: $notification – an array containing the notification information: webhook URL (the URL for your Slack account) and the payload (all of the information being sent to Slack) for the notification $notification_event – the slug of the notification event Will be false if you send a custom Slack notification that doesn’t involve a WordPress event $event_args – an array containing notification event specific information Will be false if you send a custom Slack notification that doesn’t involve a WordPress event See Notification Events below to learn which information is passed to the filters for each notification event. Filter all WordPress notifications add_filter( 'rock_the_slackbot_notification', 'filter_rock_the_slackbot_notification', 10, 3 ); function filter_rock_the_slackbot_notification( $notification, $notification_event, $event_args ) { // Change the pieces // Return the notification return $notification; } Filter WordPress notifications by webhook ID // You can find the ID for each of your webhooks on their edit screen in the admin add_filter( 'rock_the_slackbot_notification_(webhook_id)', 'filter_rock_the_slackbot_notification_webhook', 10, 3 ); function filter_rock_the_slackbot_notification_webhook( $notification, $notification_event, $event_args ) { // Change the pieces // Return the notification return $notification; } Filter WordPress notifications by event slug // The event slugs are listed below add_filter( 'rock_the_slackbot_notification_(notification_event)', 'filter_rock_the_slackbot_notification_event', 10, 3 ); function filter_rock_the_slackbot_notification_event( $notification, $notification_event, $event_args ) { // Change the pieces // Return the notification return $notification; } Filter all outgoing webhook payloads that are sent to Slack Whether it’s a WordPress notification or a simple Slack message, all messages to Slack are sent as a payload in an outgoing webhook. This filter allows you to change any payload sent to Slack in an outgoing webhook. add_filter( 'rock_the_slackbot_outgoing_webhook_payload', 'filter_rock_the_slackbot_outgoing_webhook_payload', 10, 2 ); function filter_rock_the_slackbot_outgoing_webhook_payload( $payload, $webhook_url ) { // Change the payload // Return the payload return $notification; } Notification Events Including event specific information passed to filters for each notification event. Content post_published Passed To Filters post – the WP_Post object data of the post that was published old_post_status – the status of the post before it was published new_post_status – the current status of the published post post_unpublished Passed To Filters post – the WP_Post object data of the post that was unpublished old_post_status – the status of the post before it was unpublished new_post_status – the current status of the unpublished post post_updated Passed To Filters post_id – the post ID of the post you updated post_before – the WP_Post object data of the post before it was updated post_after – the WP_Post object data of the post after it was updated post_deleted Passed To Filters post – the WP_Post object data of the post that was deleted post_trashed Passed To Filters post – the WP_Post object data of the post that was trashed is_404 Passed To Filters url – the URL that threw the 404 error referer – the HTTP referer (may not always be defined) ip_address – the IP address of the user who visited the URL (may not always be defined) user_agent – the user agent of the user who visited the URL (may not always be defined) wp_query – the WordPress query variables mysql_request – the MySQL query request Menus menu_item_deleted Passed To Filters menu – the WP_Post object data of the menu that held the menu item menu_item_id – the post ID of the menu item that was deleted Media add_attachment Passed To Filters attachment_post – the WP_Post object data for the attachment you added edit_attachment Passed To Filters attachment_post – the WP_Post object data for the attachment you edited delete_attachment Passed To Filters attachment_post – the WP_Post object data for the attachment you deleted Users user_added Passed To Filters user – the WP_User data for the user you added user_deleted Passed To Filters user – the WP_User data for the user you deleted set_user_role Passed To Filters user – the WP_User data for the user whose role was changed current_user_roles – the current user roles for the user whose role was changed old_user_roles – the old user roles for the user whose role was changed Updates core_update_available Passed To Filters current_version – the current version number of WordPress core new_version – the version number for the WordPress core update core_updated Passed To Filters current_version – the current version number of WordPress core after the update old_version – the old version number for WordPress core before the update plugin_update_available Passed To Filters plugins – includes an array of the plugins who have updates available plugin_updated Passed To Filters plugin – includes an array of the plugin(s) that were updated theme_update_available Passed To Filters themes – includes an array of the themes who have updates available theme_updated Passed To Filters theme – includes an array of the theme(s) that were updated Filter Examples You can use a filter to change the Slack notification to go to a different Slack channel according to post information, like the post category: add_filter( 'rock_the_slackbot_notification', 'filter_rock_the_slackbot_notification', 10, 3 ); function filter_rock_the_slackbot_notification( $notification, $notification_event, $event_args ) { // Only run filter for specific events switch ( $notification_event ) { // This way you can set which events you want to use case 'post_published': case 'post_unpublished': case 'post_updated': case 'post_deleted': case 'post_trashed': // Get category names $categories = wp_get_post_categories( $event_args[ 'post_id' ], array( 'fields' => 'names' ) ); // Replace 'CategoryName' with the category you're looking for if ( in_array( 'CategoryName', $categories ) ) { // Change the channel in the payload // Make sure you prefix the channel name with # $notification[ 'payload' ][ 'channel' ] = '#newchannel'; } break; } // Return the notification return $notification; }