chore: batch supporting UI, settings schema, templates, and docs updates

This commit is contained in:
Dwindi Ramadhana
2026-06-01 00:58:43 +07:00
parent 30f2fc2ea6
commit f3c4ee7124
20 changed files with 1149 additions and 54 deletions

View File

@@ -91,6 +91,8 @@ class DefaultTemplates
'order_refunded' => self::customer_order_refunded(),
'new_customer' => self::customer_new_customer(),
'newsletter_campaign' => self::customer_newsletter_campaign(),
'affiliate_application_approved' => self::customer_affiliate_application_approved(),
'affiliate_new_referral' => self::customer_affiliate_new_referral(),
],
'staff' => [
'order_placed' => self::staff_order_placed(),
@@ -104,6 +106,7 @@ class DefaultTemplates
'order_failed' => self::staff_order_failed(),
'order_cancelled' => self::staff_order_cancelled(),
'order_refunded' => self::staff_order_refunded(),
'affiliate_application_received' => self::staff_affiliate_application_received(),
],
];
@@ -141,6 +144,8 @@ class DefaultTemplates
'order_refunded' => 'Refund processed for order #{order_number}',
'new_customer' => 'Welcome to {site_name}! 🎁 Exclusive offer inside',
'newsletter_campaign' => '{campaign_title}',
'affiliate_application_approved' => 'You\'re approved! Welcome to the {site_name} Affiliate Program 🤝',
'affiliate_new_referral' => 'Ka-ching! 💰 You just earned a new referral commission',
],
'staff' => [
'order_placed' => '[NEW ORDER] #{order_number} - ${order_total} from {customer_name}',
@@ -154,6 +159,7 @@ class DefaultTemplates
'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',
'affiliate_application_received' => '[AFFILIATE APP] New application from {affiliate_name}',
],
];
@@ -748,6 +754,62 @@ We hope to serve you again soon! Check out our new arrivals:
[button url="{shop_url}"]Browse New Products[/button]';
}
/**
* Customer: Affiliate Application Approved
*/
private static function customer_affiliate_application_approved()
{
return '[card type="hero"]
## Welcome to the Affiliate Program, {affiliate_name}! 🤝
Your application has been approved. You can now start earning commissions by referring customers to {site_name}.
[/card]
[card]
**Your Details:**
Referral Code: {referral_code}
[/card]
[card type="success"]
**How to Start Earning:**
1. Go to your Affiliate Dashboard
2. Copy your unique referral link
3. Share it on your blog, social media, or with friends
4. Earn commissions when they make a purchase!
[/card]
[button url="{my_account_url}#/affiliate"]Go To Dashboard[/button]
[card type="basic"]
Have questions about the program? Contact us at {support_email}
[/card]';
}
/**
* Customer: New Affiliate Referral
*/
private static function customer_affiliate_new_referral()
{
return '[card type="hero"]
## You earned a commission! 💰
Great job, {affiliate_name}! A customer just placed an order using your referral link.
[/card]
[card type="success"]
**Referral Details:**
Order Number: #{order_number}
Commission Earned: {commission_amount} {currency}
Status: Pending (Awaiting fulfillment)
[/card]
[card]
Commissions remain pending until the order is successfully completed and the return period has passed. You can track all your referrals and payouts in your dashboard.
[/card]
[button url="{my_account_url}#/affiliate"]View Dashboard[/button]';
}
// ========================================================================
// STAFF TEMPLATES
// ========================================================================
@@ -1215,4 +1277,33 @@ Refund Date: {order_date}
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]';
}
/**
* Staff: Affiliate Application Received
* Notifies staff when a new affiliate application is submitted
*/
private static function staff_affiliate_application_received()
{
return '[card type="info"]
## 📝 New Affiliate Application
A new affiliate application has been submitted by {affiliate_name}. Please review the application details in the admin dashboard.
[/card]
[card]
**Application Details:**
Name: {affiliate_name}
Email: {affiliate_email}
Date: {application_date}
[/card]
[card type="info"]
**Action Items:**
☐ Review application details
☐ Check applicant\'s social media or website
☐ Approve or reject the application in the Woonoow Admin Dashboard
[/card]
[button url="{admin_url}"]Review Application[/button]';
}
}