Hi,
Is it possible to send telegram notifications when there is a new topic or reply…
If that plugin uses the to field (NOT the bcc field) of the email to send notifications, then it should work simply by enabling User Notifications in Private Notifications module and allowing users to connect their Telegram account using WP Telegram Login plugin.
Is it possible to send custom notifications from a custom plugin? Maybe some hook?
Yes, the plugin has a small API library included which can be used to send any type of messages to Telegram. Yo can do something like this:
if ( class_exists( 'WPTelegram_Bot_API' ) ) {
$bot_token = 'YOUR BOT TOKEN';
$bot_api = new WPTelegram_Bot_API( $bot_token );
$res = $bot_api->sendMessage([
'chat_id' => 'your telegram chat id',
'text' => 'Hello World',
]);
if ( $bot_api->is_success( $res ) ) {
$result = $res->get_result();
// do something
}
}
For custom messages to work, you need to follow all the instructions given in Private Notifications settings.