@php use App\General\SettingsClass; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Config; use App\Models\User; // Email type configuration $emailTypes = [ 'referral_signup_user' => [ 'subject' => 'Your Referral Request is Pending Approval', 'status_text' => 'Pending Approval', 'color' => '#f59e0b', // Amber 'background' => 'linear-gradient(135deg, #fef3c7 0%, #fde68a 100%)', 'icon' => '⏳', 'message' => 'Thank you for your interest in becoming a referral partner! Your application is currently under review.', 'action_required' => false, 'action_message' => '' ], 'referral_signup_admin' => [ 'subject' => 'New Referral Signup Request', 'status_text' => 'New Request', 'color' => '#3b82f6', // Blue 'background' => 'linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%)', 'icon' => '🔔', 'message' => 'A new referral partner has signed up and is waiting for your approval.', 'action_required' => true, 'action_message' => 'Please review and approve/reject this application.' ], 'referral_approved' => [ 'subject' => 'Referral Partnership Approved!', 'status_text' => 'Approved', 'color' => '#059669', // Green 'background' => 'linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%)', 'icon' => '🎉', 'message' => 'Congratulations! Your referral partnership has been approved and you can now start earning commissions.', 'action_required' => true, 'action_message' => 'Access your dashboard to start referring customers!' ] ]; // Get email type configuration $emailType = $emailTypes[$email_type ?? 'referral_signup_user'] ?? $emailTypes['referral_signup_user']; $logoPath = null; $companyName = env('APP_NAME', 'WMS'); $companyAddress = ''; $companyCity = ''; $companyState = ''; $companyPostCode = ''; $companyCountry = ''; $companyPhone = 'Contact Information'; $companyEmail = env('EMAIL_ADDRESS', 'support@example.com'); // Get admin settings data $admin = User::where('user_type', config('constants.user_types.admin'))->first(); if ($admin) { $adminSettings = DB::table('adminsettings') ->where('customer_id', $admin->id) ->whereIn('key', [ 'company_logo', 'company_name', 'company_address', 'company_city', 'company_state', 'company_post_code', 'company_country', 'company_phone', 'company_email' ]) ->pluck('value', 'key') ->toArray(); $logoPath = $adminSettings['company_logo'] ?? null; $companyName = $adminSettings['company_name'] ?? $companyName; $companyAddress = $adminSettings['company_address'] ?? $companyAddress; $companyCity = $adminSettings['company_city'] ?? $companyCity; $companyState = $adminSettings['company_state'] ?? $companyState; $companyPostCode = $adminSettings['company_post_code'] ?? $companyPostCode; $companyCountry = $adminSettings['company_country'] ?? $companyCountry; $companyPhone = $adminSettings['company_phone'] ?? $companyPhone; $companyEmail = $adminSettings['company_email'] ?? $companyEmail; } $fullAddress = trim(implode(', ', array_filter([ $companyAddress, $companyCity, $companyState, $companyPostCode, $companyCountry ]))); @endphp
{{ $emailType['message'] }}
Thank you for your interest in becoming a referral partner with {{ $companyName }}! We're excited about the opportunity to work with you.
Your application is currently under review by our team. We'll carefully evaluate your application and get back to you within 1-2 business days.
Name: {{ $name ?? 'N/A' }}
Email: {{ $email ?? 'N/A' }}
Mobile: {{ $mobile_number ?? 'N/A' }}
Status: Pending Approval
Applied On: {{ $applied_at ? (\Carbon\Carbon::parse($applied_at)->format('M d, Y \a\t g:i A')) : now()->format('M d, Y \a\t g:i A') }}
Once approved, you'll receive your unique referral code and can start earning commissions by referring new customers to our platform.
@elseif($email_type == 'referral_signup_admin')A new referral partner has submitted an application and is waiting for your review and approval.
Name: {{ $name ?? 'N/A' }}
Email: {{ $email ?? 'N/A' }}
Mobile: {{ $mobile_number ?? 'N/A' }}
Status: Pending Review
Applied On: {{ $applied_at ? (\Carbon\Carbon::parse($applied_at)->format('M d, Y \a\t g:i A')) : now()->format('M d, Y \a\t g:i A') }}
Please review this application and take appropriate action (approve or reject) based on your referral partner criteria.
Review Application @elseif($email_type == 'referral_approved')Congratulations! We're thrilled to welcome you as an official referral partner for {{ $companyName }}.
Referral Code: {{ $referral_code ?? 'N/A' }}
Referral Link: {{ $referral_link ?? 'N/A' }}
Status: Active
Approved On: {{ $approved_at ? (\Carbon\Carbon::parse($approved_at)->format('M d, Y \a\t g:i A')) : now()->format('M d, Y \a\t g:i A') }}
You can now start referring customers and earning commissions! Share your referral code or link with potential customers to start earning.
Access Your Dashboard @endif