Hi,
you can send a message by hooking new order and new users actions.
The best way to integrate and add functions is to create another plugin. For example, create a file called telegram-bot-custom.php and upload it to wp-content/plugins, then activate it. Write the file as follows.
Example:
users registration notification – NOT TESTED
<?php
/*
Plugin Name: Telegram Bot & Channel (Custom)
Description: My Custom Telegram Plugin
Author: My name
Version: 1
*/
add_action( 'user_register', function( $user_id ) {
$user_info = get_userdata( $userid );
telegram_sendmessage( $telegram_user_id, 'User '.$user_info->user_login.' has been registered!');
}, 10, 1 );
?>
https://codex.wordpress.org/Plugin_API/Action_Reference/user_register
https://codex.wordpress.org/Function_Reference/get_userdata
You have to change $telegram_user_id with your unique Telegram id. If you don’t know it, enable WP_DEBUG in WordPress and navigate to “Telegram > Subscribers” menu. You will find subcribed users ids.
As regards product broadcasting: is that a custom post type? Does “Telegram > Log” show something?
-
This reply was modified 9 years, 2 months ago by
Marco Milesi.
-
This reply was modified 9 years, 2 months ago by
Marco Milesi.
-
This reply was modified 9 years, 2 months ago by
Marco Milesi.
Thank you! I will try to do it by myself.
Can you please tell me how to check a new order and make notification not for user, just for myself, in my chanell or group.
Is “order” a custom post type or something else? Is it managed by a plugin?