Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: WooCommerce notifications for custom order status
- Plugin URI: https://www.webmenedzser.hu
- Description: Add notifications for custom order status changes
- Version: 1.0
- Author: Radics Ottó
- Author URI: https://www.webmenedzser.hu
- License: GPLv3
- */
- function send_manufacturing_email_to_customer($order_id, $order) {
- $subject = 'Szállítási információk [#' . $order_id . '] számú rendeléshez';
- $firstName = $order->billing_first_name ?? 'Vásárlónk';
- $message = "Kedves $firstName, " . PHP_EOL;
- $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.
- Köszönjük megrendelésedet.
- XY';
- wp_mail( $order->get_billing_email(), $subject, $message );
- }
- add_action( 'woocommerce_order_status_delivery', 'send_manufacturing_email_to_customer', 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement