string, 'body' => string] */ public static function get_template($event_id, $recipient_type) { $templates = self::get_all_templates(); if (isset($templates[$event_id][$recipient_type])) { return $templates[$event_id][$recipient_type]; } // Fallback return [ 'subject' => __('Notification from {store_name}', 'woonoow'), 'body' => '[card type="default"]
' . __('You have a new notification.', 'woonoow') . '
[/card]', ]; } /** * Get all default templates * * @return array */ private static function get_all_templates() { return [ // ORDER EVENTS 'order_placed' => [ 'staff' => [ 'subject' => __('New Order #{order_number} Received', 'woonoow'), 'body' => '[card type="hero"]' . __('You have received a new order from {customer_name}.', 'woonoow') . '
[/card] [card type="default"]' . __('Order Number:', 'woonoow') . ' #{order_number}
' . __('Order Total:', 'woonoow') . ' {order_total}
' . __('Order Date:', 'woonoow') . ' {order_date}
' . __('Payment Method:', 'woonoow') . ' {payment_method}
[/card] [card type="default"]' . __('Name:', 'woonoow') . ' {customer_name}
' . __('Email:', 'woonoow') . ' {customer_email}
' . __('Phone:', 'woonoow') . ' {customer_phone}
[/card] [card type="default"]' . __('Thank you for your order. We\'re now processing it and will ship it soon.', 'woonoow') . '
[/card] [card type="default"]' . __('Order Number:', 'woonoow') . ' #{order_number}
' . __('Order Total:', 'woonoow') . ' {order_total}
' . __('Order Status:', 'woonoow') . ' {order_status}
[/card] [card type="default"]' . __('We\'ll send you another email once your order has been shipped with tracking information.', 'woonoow') . '
[/card] [card type="default"]' . __('Your order has been completed. We hope you enjoy your purchase!', 'woonoow') . '
[/card] [card type="default"]' . __('Order Number:', 'woonoow') . ' #{order_number}
' . __('Order Total:', 'woonoow') . ' {order_total}
' . __('Completed Date:', 'woonoow') . ' {order_date}
[/card] [card type="default"]' . __('Thank you for shopping with us. We appreciate your business and hope to serve you again soon.', 'woonoow') . '
' . __('If you have any questions or concerns about your order, please don\'t hesitate to contact us.', 'woonoow') . '
[/card] [button link="{order_url}" style="solid"]' . __('View Order', 'woonoow') . '[/button] [button link="{store_url}" style="outline"]' . __('Continue Shopping', 'woonoow') . '[/button]', ], ], 'order_cancelled' => [ 'staff' => [ 'subject' => __('Order #{order_number} Cancelled', 'woonoow'), 'body' => '[card type="warning"]' . __('Order #{order_number} has been cancelled.', 'woonoow') . '
[/card] [card type="default"]' . __('Order Number:', 'woonoow') . ' #{order_number}
' . __('Order Total:', 'woonoow') . ' {order_total}
' . __('Customer:', 'woonoow') . ' {customer_name}
' . __('Cancelled Date:', 'woonoow') . ' {order_date}
[/card] [button link="{order_url}" style="solid"]' . __('View Order Details', 'woonoow') . '[/button]', ], ], 'order_refunded' => [ 'customer' => [ 'subject' => __('Your Order #{order_number} Has Been Refunded', 'woonoow'), 'body' => '[card type="info"]' . __('Your refund for order #{order_number} has been processed.', 'woonoow') . '
[/card] [card type="default"]' . __('Order Number:', 'woonoow') . ' #{order_number}
' . __('Refund Amount:', 'woonoow') . ' {refund_amount}
' . __('Refund Date:', 'woonoow') . ' {order_date}
[/card] [card type="default"]' . __('The refund will be credited back to your original payment method within 5-10 business days.', 'woonoow') . '
' . __('If you have any questions, please contact us.', 'woonoow') . '
[/card] [button link="{order_url}" style="solid"]' . __('View Order', 'woonoow') . '[/button]', ], ], // PRODUCT EVENTS 'low_stock' => [ 'staff' => [ 'subject' => __('Low Stock Alert: {product_name}', 'woonoow'), 'body' => '[card type="warning"]' . __('The following product is running low on stock.', 'woonoow') . '
[/card] [card type="default"]' . __('Product:', 'woonoow') . ' {product_name}
' . __('SKU:', 'woonoow') . ' {product_sku}
' . __('Current Stock:', 'woonoow') . ' {stock_quantity}
' . __('Low Stock Threshold:', 'woonoow') . ' {low_stock_threshold}
[/card] [card type="default"]' . __('Please restock this product to avoid running out of inventory.', 'woonoow') . '
[/card] [button link="{product_url}" style="solid"]' . __('View Product', 'woonoow') . '[/button]', ], ], 'out_of_stock' => [ 'staff' => [ 'subject' => __('Out of Stock Alert: {product_name}', 'woonoow'), 'body' => '[card type="warning"]' . __('The following product is now out of stock.', 'woonoow') . '
[/card] [card type="default"]' . __('Product:', 'woonoow') . ' {product_name}
' . __('SKU:', 'woonoow') . ' {product_sku}
' . __('Current Stock:', 'woonoow') . ' 0
[/card] [card type="default"]' . __('This product is no longer available for purchase. Please restock as soon as possible.', 'woonoow') . '
[/card] [button link="{product_url}" style="solid"]' . __('Manage Product', 'woonoow') . '[/button]', ], ], // CUSTOMER EVENTS 'new_customer' => [ 'customer' => [ 'subject' => __('Welcome to {store_name}!', 'woonoow'), 'body' => '[card type="hero"]' . __('Thank you for creating an account with {store_name}. We\'re excited to have you!', 'woonoow') . '
[/card] [card type="default"]' . __('Username:', 'woonoow') . ' {customer_username}
' . __('Email:', 'woonoow') . ' {customer_email}
[/card] [card type="default"]' . __('You can now log in to your account to:', 'woonoow') . '
' . __('A note has been added to your order #{order_number}.', 'woonoow') . '
[/card] [card type="default"]' . __('Order Number:', 'woonoow') . ' #{order_number}
' . __('Order Status:', 'woonoow') . ' {order_status}
[/card] [card type="default"]{customer_note}
[/card] [button link="{order_url}" style="solid"]' . __('View Order', 'woonoow') . '[/button]', ], ], ]; } }