コード例 #1
0
 /**
  * Send admins an SMS when a new order is received
  *
  * @since 1.1
  */
 public function send_admin_new_order_notification($order_id)
 {
     $notification = new WC_Twilio_SMS_Notification($order_id);
     $notification->send_admin_notification();
 }
コード例 #2
0
 /**
  * Send an SMS from the edit order page
  *
  * @since 1.1.4
  */
 public function send_order_sms()
 {
     $this->verify_request($_POST['security'], 'wc_twilio_sms_send_order_sms');
     // sanitize message
     $message = sanitize_text_field($_POST['message']);
     $order_id = is_numeric($_POST['order_id']) ? absint($_POST['order_id']) : null;
     if (!$order_id) {
         return;
     }
     $notification = new WC_Twilio_SMS_Notification($order_id);
     // send the SMS
     $notification->send_manual_customer_notification($message);
     exit(__('Message Sent', WC_Twilio_SMS::TEXT_DOMAIN));
 }