1. EmailBuilder: Fixed dialog handlers to not block all interactions - Previously dialog prevented all outside clicks - Now only blocks when WP media modal is open - Dialog can be properly closed via escape or outside click 2. DefaultTemplates: Updated new_customer email - Added note about using 'Forgot Password?' if link expires - Clear instructions for users
1178 lines
32 KiB
PHP
1178 lines
32 KiB
PHP
<?php
|
|
/**
|
|
* Default Email Templates for WooNooW
|
|
*
|
|
* Complete collection of ready-to-use email templates for online stores.
|
|
* These templates follow modern, minimal design principles and work perfectly
|
|
* without any customization required by store owners.
|
|
*
|
|
* Available Variables by Event:
|
|
*
|
|
* ORDER EVENTS (order_placed, order_confirmed, order_shipped, order_completed, order_cancelled):
|
|
* - {customer_name} - Customer's full name
|
|
* - {order_number} - Order number/ID
|
|
* - {order_date} - Order creation date
|
|
* - {order_total} - Total order amount
|
|
* - {order_url} - Link to view order details
|
|
* - {order_items} - List of ordered items
|
|
* - {payment_method} - Payment method used
|
|
* - {shipping_address} - Full shipping address
|
|
* - {billing_address} - Full billing address
|
|
* - {tracking_number} - Shipping tracking number (if available)
|
|
* - {tracking_url} - Tracking URL (if available)
|
|
*
|
|
* PAYMENT EVENTS (payment_received, payment_failed):
|
|
* - All order variables above, plus:
|
|
* - {payment_status} - Current payment status
|
|
* - {payment_date} - Payment date/time
|
|
* - {transaction_id} - Payment transaction ID
|
|
*
|
|
* CUSTOMER EVENTS (customer_registered, customer_vip_upgraded):
|
|
* - {customer_name} - Customer's full name
|
|
* - {customer_email} - Customer's email
|
|
* - {account_url} - Link to customer account
|
|
* - {vip_benefits} - List of VIP benefits (for vip_upgraded)
|
|
*
|
|
* COMMON VARIABLES (available in all templates):
|
|
* - {site_name} - Store name
|
|
* - {site_url} - Store URL
|
|
* - {support_email} - Support email address
|
|
* - {current_year} - Current year (for copyright)
|
|
*
|
|
* Card Syntax Examples:
|
|
*
|
|
* [card]
|
|
* <h2>Simple Card</h2>
|
|
* <p>Default card with white background</p>
|
|
* [/card]
|
|
*
|
|
* [card type="success"]
|
|
* <h2>Success Card</h2>
|
|
* <p>Green-themed card for positive messages</p>
|
|
* [/card]
|
|
*
|
|
* [card type="hero"]
|
|
* <h2>Hero Card</h2>
|
|
* <p>Large header card with gradient background</p>
|
|
* [/card]
|
|
*
|
|
* Button Syntax:
|
|
* <p style="text-align: center;"><a href="{order_url}" class="button">View Order</a></p>
|
|
* <p style="text-align: center;"><a href="{order_url}" class="button-outline">View Order</a></p>
|
|
*
|
|
*
|
|
* @package WooNooW
|
|
* @subpackage Email
|
|
*/
|
|
|
|
namespace WooNooW\Email;
|
|
|
|
class DefaultTemplates
|
|
{
|
|
/**
|
|
* Get all default templates organized by recipient and event
|
|
*
|
|
* @return array Associative array of templates
|
|
*/
|
|
public static function get_all_templates()
|
|
{
|
|
$templates = [
|
|
'customer' => [
|
|
'order_placed' => self::customer_order_placed(),
|
|
'order_pending' => self::customer_order_pending(),
|
|
'order_on_hold' => self::customer_order_on_hold(),
|
|
'payment_received' => self::customer_payment_received(),
|
|
'payment_failed' => self::customer_payment_failed(),
|
|
'order_processing' => self::customer_order_processing(),
|
|
'order_shipped' => self::customer_order_shipped(),
|
|
'order_completed' => self::customer_order_completed(),
|
|
'order_failed' => self::customer_order_failed(),
|
|
'order_cancelled' => self::customer_order_cancelled(),
|
|
'order_refunded' => self::customer_order_refunded(),
|
|
'new_customer' => self::customer_new_customer(),
|
|
'newsletter_campaign' => self::customer_newsletter_campaign(),
|
|
],
|
|
'staff' => [
|
|
'order_placed' => self::staff_order_placed(),
|
|
'order_pending' => self::staff_order_pending(),
|
|
'order_on_hold' => self::staff_order_on_hold(),
|
|
'payment_received' => self::staff_payment_received(),
|
|
'payment_failed' => self::staff_payment_failed(),
|
|
'order_processing' => self::staff_order_processing(),
|
|
'order_shipped' => self::staff_order_shipped(),
|
|
'order_completed' => self::staff_order_completed(),
|
|
'order_failed' => self::staff_order_failed(),
|
|
'order_cancelled' => self::staff_order_cancelled(),
|
|
'order_refunded' => self::staff_order_refunded(),
|
|
],
|
|
];
|
|
|
|
/**
|
|
* Filter: woonoow_email_default_templates
|
|
*
|
|
* Allows plugins to add or modify default email templates
|
|
*
|
|
* @param array $templates Templates organized by recipient type and event
|
|
*/
|
|
return apply_filters('woonoow_email_default_templates', $templates);
|
|
}
|
|
|
|
/**
|
|
* Get default subject for a specific template
|
|
*
|
|
* @param string $recipient 'customer' or 'staff'
|
|
* @param string $event Event type
|
|
* @return string Default subject line
|
|
*/
|
|
public static function get_default_subject($recipient, $event)
|
|
{
|
|
$subjects = [
|
|
'customer' => [
|
|
'order_placed' => 'Order confirmed: #{order_number} 📦',
|
|
'order_pending' => 'We\'re processing your order #{order_number}',
|
|
'order_on_hold' => 'Action needed: Complete payment for #{order_number}',
|
|
'payment_received' => '✓ Payment received for order #{order_number}',
|
|
'payment_failed' => 'Payment didn\'t go through - Help needed for #{order_number}',
|
|
'order_processing' => 'Great news! Your order #{order_number} is being prepared 🎉',
|
|
'order_shipped' => 'Your package is on its way! 📮 Order #{order_number}',
|
|
'order_completed' => 'Your order #{order_number} has arrived - We\'d love your feedback!',
|
|
'order_failed' => 'Issue with order #{order_number} - We\'re here to help',
|
|
'order_cancelled' => 'Order #{order_number} has been cancelled',
|
|
'order_refunded' => 'Refund processed for order #{order_number}',
|
|
'new_customer' => 'Welcome to {site_name}! 🎁 Exclusive offer inside',
|
|
'newsletter_campaign' => '{campaign_title}',
|
|
],
|
|
'staff' => [
|
|
'order_placed' => '[NEW ORDER] #{order_number} - ${order_total} from {customer_name}',
|
|
'order_pending' => '[PENDING] #{order_number} - Awaiting payment confirmation',
|
|
'order_on_hold' => '[ON HOLD] #{order_number} - {customer_name} needs to complete payment',
|
|
'payment_received' => '[PAYMENT RECEIVED] #{order_number} - ${order_total} - Ready to process',
|
|
'payment_failed' => '[PAYMENT FAILED] #{order_number} - {customer_name} - Action required',
|
|
'order_processing' => '[READY TO SHIP] #{order_number} - Begin fulfillment',
|
|
'order_shipped' => '[SHIPPED] #{order_number} - Tracking: {tracking_number}',
|
|
'order_completed' => '[COMPLETED] #{order_number} - Customer received delivery',
|
|
'order_failed' => '[FAILED] #{order_number} - Unable to process',
|
|
'order_cancelled' => '[CANCELLED] #{order_number} - Refund may be required',
|
|
'order_refunded' => '[REFUNDED] #{order_number} - ${order_total} refunded to customer',
|
|
],
|
|
];
|
|
|
|
$subject = $subjects[$recipient][$event] ?? '';
|
|
|
|
/**
|
|
* Filter: woonoow_email_default_subject
|
|
*
|
|
* Allows plugins to modify default email subjects
|
|
*
|
|
* @param string $subject Default subject line
|
|
* @param string $recipient Recipient type ('customer' or 'staff')
|
|
* @param string $event Event ID
|
|
*/
|
|
return apply_filters('woonoow_email_default_subject', $subject, $recipient, $event);
|
|
}
|
|
|
|
// ========================================================================
|
|
// CUSTOMER TEMPLATES
|
|
// ========================================================================
|
|
|
|
/**
|
|
* Customer: New Customer
|
|
* Sent when customer creates an account
|
|
*/
|
|
private static function customer_new_customer()
|
|
{
|
|
return '[card type="hero"]
|
|
## Welcome to {site_name}, {customer_name}! 🎉
|
|
|
|
Your account is ready. Here\'s what you can do now:
|
|
[/card]
|
|
|
|
[card]
|
|
**Your Account Benefits:**
|
|
✓ Track orders in real-time with live updates
|
|
✓ Save your favorite items for later
|
|
✓ Faster checkout on future purchases
|
|
✓ Exclusive member deals and early access
|
|
✓ Easy returns and refunds
|
|
[/card]
|
|
|
|
[card type="warning"]
|
|
**Important:** Please set your password to access your account:
|
|
|
|
[button url="{set_password_url}" style="solid"]Set Your Password[/button]
|
|
|
|
This link expires in 24 hours. If expired, use "Forgot Password?" on the login page.
|
|
[/card]
|
|
|
|
[button url="{shop_url}" style="outline"]Start Shopping[/button]
|
|
|
|
[card type="basic"]
|
|
Got questions? Our customer service team is ready to help: {support_email}
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Newsletter Campaign
|
|
* Master design template for newsletter campaigns
|
|
* The {content} variable is replaced with the actual campaign content
|
|
*/
|
|
private static function customer_newsletter_campaign()
|
|
{
|
|
return '[card type="hero"]
|
|
## {campaign_title}
|
|
[/card]
|
|
|
|
[card]
|
|
{content}
|
|
[/card]
|
|
|
|
[card type="basic" bg="#f5f5f5"]
|
|
You are receiving this because you subscribed to {site_name} newsletter.
|
|
|
|
[Unsubscribe]({unsubscribe_url}) | [Visit Store]({site_url})
|
|
|
|
© {current_year} {site_name}. All rights reserved.
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Order Placed
|
|
* Sent immediately when customer places an order
|
|
*/
|
|
private static function customer_order_placed()
|
|
{
|
|
return '[card type="hero"]
|
|
## Thank you for your order, {customer_name}! 🎊
|
|
|
|
We\'ve received your order and it\'s now in our system. We\'re working on it right now!
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Details:**
|
|
Order Number: #{order_number}
|
|
Order Date: {order_date}
|
|
Order Total: {order_total}
|
|
[/card]
|
|
|
|
[card]
|
|
**What You Ordered:**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[card]
|
|
**Shipping Address:**
|
|
{shipping_address}
|
|
|
|
**Payment Method:** {payment_method}
|
|
[/card]
|
|
|
|
[button url="{order_url}"]View Complete Order[/button]
|
|
|
|
[card type="success"]
|
|
**What Happens Next?**
|
|
1. We\'ll verify your payment (2-4 hours)
|
|
2. Our team will prepare and pack your items
|
|
3. You\'ll get a shipping notification with tracking info
|
|
4. Your package will arrive within 3-7 business days
|
|
|
|
Most orders ship the same business day!
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
📌 **Save this email for reference.** You\'ll need your order number {order_number} if you need to contact us.
|
|
[/card]
|
|
|
|
[card type="basic"]
|
|
Questions or need to make changes? Reply to this email or contact us at {support_email}
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Order Pending
|
|
* Sent when order is pending payment confirmation
|
|
*/
|
|
private static function customer_order_pending()
|
|
{
|
|
return '[card type="info"]
|
|
## Your order is pending, {customer_name}
|
|
|
|
We\'ve received your order #{order_number}, and it\'s waiting for payment confirmation. This usually takes just a few minutes.
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Summary:**
|
|
Order Number: #{order_number}
|
|
Order Total: {order_total}
|
|
Payment Method: {payment_method}
|
|
Order Date: {order_date}
|
|
[/card]
|
|
|
|
[card]
|
|
**Items:**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[button url="{order_url}"]Check Order Status[/button]
|
|
|
|
[card type="info"]
|
|
⏱️ If you don\'t see a payment confirmation within 30 minutes, don\'t worry! Click the button above to check the status, or your bank may require additional verification.
|
|
[/card]
|
|
|
|
[card type="basic"]
|
|
Having payment issues? Contact us at {support_email} and we\'ll help you sort it out quickly.
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Order On-Hold
|
|
* Sent when order requires customer action
|
|
*/
|
|
private static function customer_order_on_hold()
|
|
{
|
|
return '[card type="warning"]
|
|
## Your order is on hold, {customer_name}
|
|
|
|
Order #{order_number} is waiting for payment confirmation. Complete payment now to get your order processing!
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Number:** #{order_number}
|
|
**Order Total:** {order_total}
|
|
**Payment Method:** {payment_method}
|
|
[/card]
|
|
|
|
[button url="{payment_retry_url}"]Complete Payment Now[/button]
|
|
|
|
[card type="info"]
|
|
**Why is this on hold?**
|
|
We haven\'t received payment confirmation yet. This is common and easily fixed!
|
|
|
|
**Common reasons:**
|
|
• Payment gateway needs more details
|
|
• Bank security check required
|
|
• Payment was declined temporarily
|
|
|
|
Please try again or contact your bank to authorize this transaction.
|
|
[/card]
|
|
|
|
[card]
|
|
**Don\'t lose your items!** Complete payment within 24 hours to keep your order reserved. After that, items may become unavailable.
|
|
[/card]
|
|
|
|
[card type="basic"]
|
|
Still having trouble? We\'re here: {support_email}
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Payment Received
|
|
* Sent when payment is successfully processed
|
|
*/
|
|
private static function customer_payment_received()
|
|
{
|
|
return '[card type="success"]
|
|
## ✓ Payment confirmed!
|
|
|
|
Great news, {customer_name}! Your payment has been successfully processed. Your order #{order_number} is now confirmed and being prepared for shipment.
|
|
[/card]
|
|
|
|
[card]
|
|
**Payment Confirmed:**
|
|
Amount: {order_total}
|
|
Transaction ID: {transaction_id}
|
|
Payment Method: {payment_method}
|
|
Date: {payment_date}
|
|
[/card]
|
|
|
|
[card]
|
|
**What\'s next?**
|
|
1. Our warehouse team is picking and packing your items (usually 24 hours)
|
|
2. We\'ll generate your shipping label and notify you
|
|
3. Your package will ship out soon with tracking info
|
|
4. Estimated delivery: 3-7 business days
|
|
[/card]
|
|
|
|
[button url="{order_url}"]View Your Order[/button]
|
|
|
|
[card type="info"]
|
|
🚚 You\'ll receive a shipping notification with tracking information as soon as your package ships. You can follow your delivery in real-time!
|
|
[/card]
|
|
|
|
[card type="basic"]
|
|
Questions? Keep this email handy and contact us: {support_email}
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Payment Failed
|
|
* Sent when payment processing fails
|
|
*/
|
|
private static function customer_payment_failed()
|
|
{
|
|
return '[card type="warning"]
|
|
## Payment couldn\'t be processed
|
|
|
|
We tried to process your payment for order #{order_number}, but it was declined. Don\'t worry—this is easily fixed, and your order is still reserved!
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Details:**
|
|
Order Number: #{order_number}
|
|
Order Total: {order_total}
|
|
Reason: {payment_error_reason}
|
|
[/card]
|
|
|
|
[button url="{payment_retry_url}"]Update Payment Method[/button]
|
|
|
|
[card type="info"]
|
|
**Why did this happen?**
|
|
• Insufficient funds
|
|
• Card expired or blocked
|
|
• Incorrect card details
|
|
• Bank declined for security reasons
|
|
• Wrong billing address
|
|
|
|
**Easy fix:**
|
|
Try paying with a different card or update your payment method using the button above.
|
|
[/card]
|
|
|
|
[card]
|
|
**Your order is still available for 24 hours.** After that, we\'ll need to release your reserved items.
|
|
|
|
**Action needed:** Please update your payment within 24 hours to proceed with your order.
|
|
[/card]
|
|
|
|
[card type="basic"]
|
|
Still having issues? Our team can help: {support_email}
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Order Processing
|
|
* Sent when order payment is confirmed and ready for shipment
|
|
*/
|
|
private static function customer_order_processing()
|
|
{
|
|
return '[card type="success"]
|
|
## 🎉 Your order is being prepared!
|
|
|
|
Exciting news, {customer_name}! Your payment has been confirmed and order #{order_number} is now being packed and prepared for shipment.
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Number:** #{order_number}
|
|
**Order Total:** {order_total}
|
|
**Status:** Being Prepared
|
|
**Estimated Dispatch:** Within 24 hours
|
|
[/card]
|
|
|
|
[card]
|
|
**Your Items:**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[card type="success"]
|
|
**Order Progress:**
|
|
✓ Payment received
|
|
✓ Order confirmed
|
|
⏳ Being packed and quality checked
|
|
⏳ Generating shipping label
|
|
⏳ Dispatching your package
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
📦 **You\'re almost there!** Your package will ship within 24 hours. Once it does, you\'ll get a notification with tracking info so you can watch your delivery in real-time.
|
|
[/card]
|
|
|
|
[button url="{order_url}"]Track Your Order[/button]
|
|
|
|
[card type="basic"]
|
|
Questions about your order? {support_email}
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Order Shipped
|
|
* Sent when order is dispatched
|
|
*/
|
|
private static function customer_order_shipped()
|
|
{
|
|
return '[card type="success"]
|
|
## 🚚 Your package is on its way!
|
|
|
|
Your order #{order_number} has shipped! Track your package below and get real-time delivery updates.
|
|
[/card]
|
|
|
|
[card]
|
|
**Tracking Information:**
|
|
Tracking Number: {tracking_number}
|
|
Carrier: {shipping_carrier}
|
|
Shipped: {order_date}
|
|
Estimated Delivery: 3-7 business days
|
|
[/card]
|
|
|
|
[button url="{tracking_url}"]Track Your Package[/button]
|
|
|
|
[card]
|
|
**Your Items:**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
**What to expect:**
|
|
• You\'ll see "In Transit" status once the carrier scans it at their facility
|
|
• Delivery date may update as the package moves
|
|
• You might receive a delivery notification from the carrier
|
|
• Contact the carrier directly if the package doesn\'t arrive by the estimated date
|
|
|
|
📍 **Tip:** Add the tracking number to your phone contacts or set email alerts for delivery updates!
|
|
[/card]
|
|
|
|
[card type="basic"]
|
|
Any issues? Contact us: {support_email}
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Order Completed
|
|
* Sent when order is delivered
|
|
*/
|
|
private static function customer_order_completed()
|
|
{
|
|
return '[card type="success"]
|
|
## 📦 Your order has arrived!
|
|
|
|
Your order #{order_number} has been delivered! We hope you love your purchase. Your feedback helps us provide better service and special offers.
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Summary:**
|
|
Order Number: #{order_number}
|
|
Delivered: {completion_date}
|
|
Order Total: {order_total}
|
|
[/card]
|
|
|
|
[card]
|
|
**Your Items:**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[button url="{review_url}"]Share Your Review ⭐[/button]
|
|
|
|
[card type="success"]
|
|
**Why your review matters:**
|
|
✓ Helps other customers make great choices
|
|
✓ Helps us improve our products and service
|
|
✓ Reviewers get exclusive discounts on future purchases!
|
|
✓ You might be featured on our site
|
|
|
|
Leave a review and let us know what you think. Even 2-3 sentences help!
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
**Issues with your order?** If anything\'s wrong, damaged, or not what you expected, let us know immediately. We\'ll make it right!
|
|
[/card]
|
|
|
|
[button url="{return_url}"]Initiate Return or Exchange[/button]
|
|
|
|
[card type="basic"]
|
|
Thanks for shopping with us! Questions? {support_email}
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Order Failed
|
|
* Sent when order fails processing
|
|
*/
|
|
private static function customer_order_failed()
|
|
{
|
|
return '[card type="warning"]
|
|
## Issue with order #{order_number}
|
|
|
|
Unfortunately, we weren\'t able to process your order #{order_number}. This sometimes happens due to system issues or inventory problems.
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Number:** #{order_number}
|
|
**Order Total:** {order_total}
|
|
**Date:** {order_date}
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
**What now?**
|
|
We\'re investigating this issue and our team will contact you shortly with details and next steps.
|
|
|
|
In the meantime, you can:
|
|
[/card]
|
|
|
|
[button url="{shop_url}"]Browse More Products[/button]
|
|
[button url="{contact_url}"]Contact Our Team[/button]
|
|
|
|
[card]
|
|
We apologize for the inconvenience. We\'re here to help make this right!
|
|
[/card]
|
|
|
|
[card type="basic"]
|
|
Questions? Contact us immediately: {support_email}
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Order Cancelled
|
|
* Sent when order is cancelled
|
|
*/
|
|
private static function customer_order_cancelled()
|
|
{
|
|
return '[card type="warning"]
|
|
## Order #{order_number} has been cancelled
|
|
|
|
Your order has been cancelled. Here\'s what you need to know:
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Details:**
|
|
Order Number: #{order_number}
|
|
Order Total: {order_total}
|
|
Cancellation Date: {order_date}
|
|
[/card]
|
|
|
|
[card]
|
|
**Items That Won\'t Ship:**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[card type="success"]
|
|
**Refund Status:**
|
|
If you made a payment, we\'re processing your refund to your original payment method. This usually takes 5-7 business days, but sometimes longer depending on your bank.
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
**Why was this cancelled?**
|
|
This usually happens because:
|
|
• You requested the cancellation
|
|
• Payment couldn\'t be confirmed
|
|
• Items became out of stock
|
|
• You had a payment issue that wasn\'t resolved
|
|
|
|
If this wasn\'t your decision and you\'d like to place a new order, we\'re here to help!
|
|
[/card]
|
|
|
|
[button url="{shop_url}"]Shop Again[/button]
|
|
[button url="{contact_url}"]Talk to Us[/button]
|
|
|
|
[card type="basic"]
|
|
We\'d love to know what we could have done better. Your feedback helps us improve: {support_email}
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Customer: Order Refunded
|
|
* Sent when order is refunded
|
|
*/
|
|
private static function customer_order_refunded()
|
|
{
|
|
return '[card type="success"]
|
|
## ✓ Your refund has been processed!
|
|
|
|
We\'ve successfully processed a refund of {order_total} for order #{order_number}.
|
|
[/card]
|
|
|
|
[card]
|
|
**Refund Details:**
|
|
Order Number: #{order_number}
|
|
Refund Amount: {order_total}
|
|
Refund Date: {order_date}
|
|
Original Payment Method: {payment_method}
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
**When will I see the refund?**
|
|
• 5-10 business days: Most refunds appear within this timeframe
|
|
• 10-14 business days: Some banks take longer to process
|
|
• Check with your bank if it takes longer than 14 days
|
|
|
|
The refund will go back to the original payment method you used. If you paid with a credit card, it may show as a credit on your statement.
|
|
[/card]
|
|
|
|
[card]
|
|
**Items Returned:**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[card type="basic"]
|
|
Have questions about your refund? {support_email}
|
|
|
|
We hope to serve you again soon! Check out our new arrivals:
|
|
[/card]
|
|
|
|
[button url="{shop_url}"]Browse New Products[/button]';
|
|
}
|
|
|
|
// ========================================================================
|
|
// STAFF TEMPLATES
|
|
// ========================================================================
|
|
|
|
/**
|
|
* Staff: Order Placed
|
|
* Notifies staff when customer places an order
|
|
*/
|
|
private static function staff_order_placed()
|
|
{
|
|
return '[card type="hero"]
|
|
## 📬 New Order Received!
|
|
|
|
A customer has just placed an order. Review the details below and begin processing.
|
|
[/card]
|
|
|
|
[card]
|
|
**Customer Information:**
|
|
Name: {customer_name}
|
|
Email: {customer_email}
|
|
Phone: {customer_phone}
|
|
|
|
**Order Details:**
|
|
Order Number: #{order_number}
|
|
Order Date: {order_date}
|
|
Order Total: {order_total}
|
|
Payment Status: {payment_status}
|
|
[/card]
|
|
|
|
[card]
|
|
**Items Ordered:**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[card]
|
|
**Shipping Address:**
|
|
{shipping_address}
|
|
|
|
**Billing Address:**
|
|
{billing_address}
|
|
[/card]
|
|
|
|
[card]
|
|
**Payment Method:** {payment_method}
|
|
[/card]
|
|
|
|
[button url="{order_url}"]Open Order in Dashboard[/button]
|
|
|
|
[card type="info"]
|
|
**Next Steps:**
|
|
• Verify payment status
|
|
• Check inventory availability
|
|
• Confirm items are in stock
|
|
• Flag any issues for follow-up
|
|
• Begin picking items when ready
|
|
|
|
**⚠️ Action Required:** If payment status is not confirmed, follow up with customer or wait for payment gateway to process.
|
|
[/card]
|
|
|
|
[card type="basic"]
|
|
Questions or issues? Check the dashboard or contact management.
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Staff: Order Pending
|
|
* Notifies staff of pending orders awaiting payment
|
|
*/
|
|
private static function staff_order_pending()
|
|
{
|
|
return '[card type="info"]
|
|
## ⏱️ Order Pending Payment
|
|
|
|
Order #{order_number} from {customer_name} is awaiting payment confirmation.
|
|
[/card]
|
|
|
|
[card]
|
|
**Customer:** {customer_name}
|
|
**Order Number:** #{order_number}
|
|
**Order Total:** {order_total}
|
|
**Payment Method:** {payment_method}
|
|
**Date Placed:** {order_date}
|
|
[/card]
|
|
|
|
[card]
|
|
**Items:**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[button url="{order_url}"]View in Dashboard[/button]
|
|
|
|
[card type="info"]
|
|
**Action Items:**
|
|
• Monitor payment status
|
|
• Prepare items if pre-order or inventory allows
|
|
• Contact customer if payment isn\'t received within 24 hours
|
|
• Consider automatic cancellation if payment not received after configured timeout
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Staff: Order On-Hold
|
|
* Notifies staff when order requires customer attention
|
|
*/
|
|
private static function staff_order_on_hold()
|
|
{
|
|
return '[card type="warning"]
|
|
## 🔒 Order On-Hold
|
|
|
|
Order #{order_number} from {customer_name} is on hold. Action required from customer.
|
|
[/card]
|
|
|
|
[card]
|
|
**Customer:** {customer_name}
|
|
**Email:** {customer_email}
|
|
**Order Number:** #{order_number}
|
|
**Order Total:** {order_total}
|
|
**Hold Reason:** Awaiting payment confirmation
|
|
[/card]
|
|
|
|
[button url="{order_url}"]View Order[/button]
|
|
|
|
[card type="info"]
|
|
**Status:** Waiting for customer to complete payment or resolve issue.
|
|
|
|
**Recommended Actions:**
|
|
• Wait 24 hours for customer response
|
|
• Send manual follow-up if no response
|
|
• Check customer\'s email for payment retry
|
|
• Consider auto-cancellation per your policy
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Staff: Payment Received
|
|
* Notifies staff when payment is successfully received
|
|
*/
|
|
private static function staff_payment_received()
|
|
{
|
|
return '[card type="success"]
|
|
## ✓ Payment Received!
|
|
|
|
Payment successfully processed for order #{order_number}. Order is now ready for fulfillment.
|
|
[/card]
|
|
|
|
[card]
|
|
**Payment Details:**
|
|
Amount: {order_total}
|
|
Payment Method: {payment_method}
|
|
Transaction ID: {transaction_id}
|
|
Date: {payment_date}
|
|
|
|
**Customer:** {customer_name}
|
|
**Order Number:** #{order_number}
|
|
[/card]
|
|
|
|
[card]
|
|
**Items to Prepare:**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[card type="success"]
|
|
**Ready to Process:**
|
|
✓ Payment confirmed
|
|
✓ Order in system
|
|
📦 Begin picking and packing
|
|
🏷️ Generate shipping label
|
|
📮 Prepare for dispatch
|
|
[/card]
|
|
|
|
[button url="{order_url}"]Start Processing[/button]
|
|
|
|
[card type="info"]
|
|
Order is now confirmed and ready for fulfillment. Begin preparation immediately to meet dispatch targets.
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Staff: Payment Failed
|
|
* Notifies staff when payment processing fails
|
|
*/
|
|
private static function staff_payment_failed()
|
|
{
|
|
return '[card type="warning"]
|
|
## ⚠️ Payment Failed
|
|
|
|
Payment processing failed for order #{order_number}. Order is on hold pending customer action.
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Details:**
|
|
Order Number: #{order_number}
|
|
Customer: {customer_name}
|
|
Amount: {order_total}
|
|
Payment Method: {payment_method}
|
|
Failed Date: {payment_date}
|
|
Failure Reason: {payment_error_reason}
|
|
[/card]
|
|
|
|
[button url="{order_url}"]View Details[/button]
|
|
|
|
[card type="warning"]
|
|
**Status:** On Hold - Awaiting Payment Retry
|
|
|
|
**Action Items:**
|
|
1. Customer has been notified automatically
|
|
2. Order is reserved for 24 hours
|
|
3. Monitor for payment retry from customer
|
|
4. After 24 hours with no payment: auto-cancel per policy or contact customer
|
|
5. Do NOT prepare items until payment is confirmed
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
**Follow-Up Timeline:**
|
|
• 0 hours: Payment fails, customer notified
|
|
• 12 hours: Check if customer retried payment
|
|
• 24 hours: Reach out to customer if no payment received
|
|
• 48 hours: Consider cancellation if no response
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Staff: Order Processing
|
|
* Notifies staff when order is confirmed and ready to process
|
|
*/
|
|
private static function staff_order_processing()
|
|
{
|
|
return '[card type="success"]
|
|
## ✅ Order Confirmed & Ready to Process
|
|
|
|
Order #{order_number} is confirmed. Payment received. Begin preparation and packing immediately.
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Details:**
|
|
Order Number: #{order_number}
|
|
Customer: {customer_name}
|
|
Order Total: {order_total}
|
|
Confirmed Date: {order_date}
|
|
[/card]
|
|
|
|
[card]
|
|
**Items to Pick & Pack:**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[card type="success"]
|
|
**Fulfillment Checklist:**
|
|
☐ Pick all items from inventory
|
|
☐ Verify quality and condition
|
|
☐ Pack securely with packing material
|
|
☐ Generate shipping label
|
|
☐ Weigh and verify dimensions
|
|
☐ Arrange pickup with carrier
|
|
☐ Update order status to "Shipped"
|
|
☐ Send tracking info to customer
|
|
[/card]
|
|
|
|
[button url="{order_url}"]Open Full Order[/button]
|
|
|
|
[card type="info"]
|
|
**Target Dispatch:** Within 24 hours
|
|
Keep this order moving through fulfillment to maintain on-time delivery.
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Staff: Order Shipped
|
|
* Notifies staff when order is marked as shipped
|
|
*/
|
|
private static function staff_order_shipped()
|
|
{
|
|
return '[card type="success"]
|
|
## 📮 Order Shipped
|
|
|
|
Order #{order_number} has been dispatched. Customer automatically notified with tracking information.
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Details:**
|
|
Order Number: #{order_number}
|
|
Customer: {customer_name}
|
|
Tracking Number: {tracking_number}
|
|
Carrier: {shipping_carrier}
|
|
Shipped Date: {order_date}
|
|
[/card]
|
|
|
|
[button url="{order_url}"]View Order[/button]
|
|
|
|
[card type="success"]
|
|
✓ Picked and packed
|
|
✓ Shipping label generated
|
|
✓ Picked up by carrier
|
|
✓ Customer notified with tracking info
|
|
|
|
**Customer can now track their shipment in real-time.**
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
Order is in transit. Monitor for any delivery issues or customer inquiries about tracking.
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Staff: Order Completed
|
|
* Notifies staff when order is completed/delivered
|
|
*/
|
|
private static function staff_order_completed()
|
|
{
|
|
return '[card type="success"]
|
|
## ✅ Order Completed
|
|
|
|
Order #{order_number} has been delivered to customer. All fulfillment steps completed successfully.
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Summary:**
|
|
Order Number: #{order_number}
|
|
Customer: {customer_name}
|
|
Order Total: {order_total}
|
|
Completed Date: {order_date}
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Journey:**
|
|
✓ Order placed
|
|
✓ Payment received
|
|
✓ Order prepared & packed
|
|
✓ Shipped with tracking
|
|
✓ Delivered to customer
|
|
[/card]
|
|
|
|
[card type="success"]
|
|
**Customer Experience:**
|
|
✓ Customer notified
|
|
✓ Invited to leave review
|
|
✓ Offered return option
|
|
✓ Follow-up actions triggered
|
|
|
|
Consider this order a success!
|
|
[/card]
|
|
|
|
[button url="{order_url}"]View Order Details[/button]
|
|
|
|
[card type="info"]
|
|
Monitor for customer reviews and feedback. Flag any issues that arise for continuous improvement.
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Staff: Order Failed
|
|
* Notifies staff when order fails
|
|
*/
|
|
private static function staff_order_failed()
|
|
{
|
|
return '[card type="warning"]
|
|
## ❌ Order Failed
|
|
|
|
Order #{order_number} from {customer_name} could not be processed. Immediate action required.
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Details:**
|
|
Order Number: #{order_number}
|
|
Customer: {customer_name}
|
|
Order Total: {order_total}
|
|
Failure Date: {order_date}
|
|
[/card]
|
|
|
|
[button url="{order_url}"]View Details & Investigate[/button]
|
|
|
|
[card type="warning"]
|
|
**Immediate Actions Required:**
|
|
1. Investigate the failure reason (payment? inventory? system?)
|
|
2. Contact customer with explanation and solution
|
|
3. Offer alternatives (different payment method, substitute items, etc.)
|
|
4. Provide timeline for resolution
|
|
5. Process refund if no resolution path found
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
This order requires staff attention to resolve and maintain customer satisfaction.
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Staff: Order Cancelled
|
|
* Notifies staff when order is cancelled
|
|
*/
|
|
private static function staff_order_cancelled()
|
|
{
|
|
return '[card type="warning"]
|
|
## ❌ Order Cancelled
|
|
|
|
Order #{order_number} from {customer_name} has been cancelled. Refund processing may be required.
|
|
[/card]
|
|
|
|
[card]
|
|
**Order Details:**
|
|
Order Number: #{order_number}
|
|
Customer: {customer_name}
|
|
Order Total: {order_total}
|
|
Cancelled Date: {order_date}
|
|
[/card]
|
|
|
|
[card]
|
|
**Items (Will Not Ship):**
|
|
{order_items_table}
|
|
[/card]
|
|
|
|
[card type="warning"]
|
|
**Action Items:**
|
|
☐ Check if payment was received
|
|
☐ If paid: Process refund to original payment method
|
|
☐ Update inventory for cancelled items
|
|
☐ Check warehouse if order was partially prepared
|
|
☐ Confirm cancellation with customer
|
|
☐ Log cancellation reason for analytics
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
**Refund Timeline:**
|
|
• Immediate: Process refund in system
|
|
• 5-10 days: Customer sees refund in their account
|
|
• Communicate expected timeline to customer
|
|
[/card]
|
|
|
|
[button url="{order_url}"]View & Process Refund[/button]
|
|
|
|
[card type="basic"]
|
|
Document the cancellation reason for business intelligence. Customer satisfaction is important.
|
|
[/card]';
|
|
}
|
|
|
|
/**
|
|
* Staff: Order Refunded
|
|
* Notifies staff when order is refunded
|
|
*/
|
|
private static function staff_order_refunded()
|
|
{
|
|
return '[card type="success"]
|
|
## ✓ Refund Processed
|
|
|
|
Order #{order_number} has been refunded. Customer automatically notified of refund details.
|
|
[/card]
|
|
|
|
[card]
|
|
**Refund Details:**
|
|
Order Number: #{order_number}
|
|
Customer: {customer_name}
|
|
Refund Amount: {order_total}
|
|
Refund Date: {order_date}
|
|
[/card]
|
|
|
|
[button url="{order_url}"]View Order[/button]
|
|
|
|
[card type="success"]
|
|
✓ Refund processed to: {payment_method}
|
|
✓ Customer notified with timeline
|
|
✓ Expected to appear: 5-10 business days
|
|
✓ Order status updated
|
|
[/card]
|
|
|
|
[card type="info"]
|
|
Customer will see refund in their account within 5-10 business days depending on their bank. Flag if customer inquires about missing refund after 14 days.
|
|
[/card]';
|
|
}
|
|
} |