Hello,
Do you receive an email notification when that happens?
Thread Starter
almsit
(@almsit)
I get a notification for any event: when a user adds to the waiting list, makes an order, pays, and so on. I want to disable when the user adds to the waiting list. how to do it?
There is a filter wptelegram_notify_send_notification
that you can use to avoid sending notification to Telegram:
add_filter( 'wptelegram_notify_send_notification', function ( $send, $args ) {
// If the email subject contains the string "on-hold"
$item_put_on_hold = false !== strpos( strtolower( $args['subject'] ), 'on-hold' );
if ( $item_put_on_hold ) {
$send = false;
}
return $send;
}, 10, 2 );
That’s just an example which you will need to update as per your needs.
Thread Starter
almsit
(@almsit)
Thank you. It worked. For some reason, the other day it stopped working (the hook does not work). Debug does not display a message. What to do?
I already mentioned that it was only an example and you might need to update it as per your requirements.
Thread Starter
almsit
(@almsit)
I modified your example to suit my needs. It worked well for about 2 months. Now, when processing a telegram event, it doesn’t even know the function (echo “1”; do not display admin-ajax in response), as if the hook is not hooked. What to do here?
That means the notification is not triggered at all. Please ensure that the corresponding email notification is sent to an email address saved on Private Notifications settings.
Thread Starter
almsit
(@almsit)
how to make the hook work without including it in the settings? can change it? because now with any order, changes in the status of the order and so on come in notifications. It is necessary to me that came only then when the user rises in a waiting list.
The plugin watches the emails sent out to the email address you specify in the settings. Those emails are then forwarded to Telegram. So you need to ensure that emails are sent to the email address you specify.
Thread Starter
almsit
(@almsit)
Thank you. How to make telegram notifications only about orders? now they come about changing the password, and about registering a user, and more. Is there any hook?
How to make telegram notifications only about orders?
You can add another specific email address in WooCommerce email settings for “New Order”, then use that email in Private Notifications settings of WP Telegram