Skip to content

Instantly share code, notes, and snippets.

@PechenkiUA
Created March 28, 2023 17:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PechenkiUA/fde0fa27a4798d3fa8772df6e2b75eb8 to your computer and use it in GitHub Desktop.
Save PechenkiUA/fde0fa27a4798d3fa8772df6e2b75eb8 to your computer and use it in GitHub Desktop.
Send message from change status
<?php
/**
* Send message from change status
*/
add_action('woocommerce_order_status_changed',function ( $order_id, $old_status, $new_status, $order){
global $Telsender;
if ($new_status == 'processing'){
$text = sprintf('%s - order_status_changed',$new_status);
$Telsender->telegram->SendMesage($text);
}
}, 10, 4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment