Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.24 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: WooCommerce notifications for custom order status
  4. Plugin URI: https://www.webmenedzser.hu
  5. Description: Add notifications for custom order status changes
  6. Version: 1.0
  7. Author: Radics Ottó
  8. Author URI: https://www.webmenedzser.hu
  9. License: GPLv3
  10. */
  11.  
  12. function send_manufacturing_email_to_customer($order_id, $order) {
  13.     $subject = 'Szállítási információk [#' . $order_id . '] számú rendeléshez';
  14.     $firstName = $order->billing_first_name ?? 'Vásárlónk';
  15.  
  16.     $message = "Kedves $firstName, " . PHP_EOL;
  17.  
  18.     $message .= $order_id . '. azonosítójú rendelésedet átadtuk a futárszolgálatnak. Két napon belül, a rendelés során megadott mobilszámra érkező SMS-ben tájékoztatást kapsz a csomag kézbesítésének reggelén. A szöveges üzenet tartalmazza a csomag azonosítószámát, a kézbesítés várható idejét egy 3 órás időintervallumban (pl.: 8 – 11 óra között) és a GLS ügyfélszolgálat telefonszámát, ahol egyeztethetsz a kiszállítással kapcsolatban.
  19.  
  20.        Köszönjük megrendelésedet.
  21.  
  22.        XY';
  23.  
  24.     wp_mail( $order->get_billing_email(), $subject, $message );
  25. }
  26. add_action( 'woocommerce_order_status_delivery', 'send_manufacturing_email_to_customer', 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement