/home/awneajlw/public_html/codestechvista.com/config/twilio_config.php
<?php
/**
* Twilio SMS Configuration
* Configure Twilio settings for SMS notifications
*/
// Twilio Configuration
define('TWILIO_ACCOUNT_SID', 'ACc5b3a38c8a527efa63042d2fe823ed01'); // Your Twilio Account SID
define('TWILIO_AUTH_TOKEN', '50baa922666befb9d5b496e5d451821e'); // Your Twilio Auth Token
define('TWILIO_PHONE_NUMBER', '+12272329731'); // Your Twilio phone number
// WhatsApp Configuration
define('TWILIO_WHATSAPP_NUMBER', 'whatsapp:+12272329731'); // Twilio WhatsApp Sandbox number
define('ADMIN_WHATSAPP_NUMBER', 'whatsapp:+12272329731'); // Admin WhatsApp number (UPDATE THIS)
// Admin notification number
define('ADMIN_PHONE_NUMBER', '+12272329731'); // Replace with admin phone number
// Notification Settings
define('SMS_ENABLED', true); // Enable/disable SMS notifications
define('WHATSAPP_ENABLED', true); // Enable/disable WhatsApp notifications
define('SMS_DEBUG', true); // Enable debug mode for testing (ENABLED FOR TESTING)
define('WHATSAPP_DEBUG', true); // Enable WhatsApp debug mode (ENABLED FOR TESTING)
/**
* WhatsApp Message Templates
*/
class WhatsAppTemplates {
/**
* New Order WhatsApp Template
*/
public static function newOrder($order_id, $customer_name, $total_amount) {
return "π *NEW ORDER ALERT!*\n\n" .
"π *Order Details:*\n" .
"π Order ID: *#$order_id*\n" .
"π€ Customer: *$customer_name*\n" .
"π° Amount: *PKR $total_amount*\n" .
"π Status: *New Order*\n\n" .
"β° Time: " . date('d M Y, h:i A') . "\n\n" .
"π± *OPTI SLIP - Eye Clinic Management*";
}
/**
* Order Completed WhatsApp Template
*/
public static function orderCompleted($order_id, $customer_name, $total_amount) {
return "β
*ORDER COMPLETED!*\n\n" .
"π Great news! Order has been completed.\n\n" .
"π *Order Details:*\n" .
"π Order ID: *#$order_id*\n" .
"π€ Customer: *$customer_name*\n" .
"π° Amount: *PKR $total_amount*\n" .
"π Status: *Completed*\n\n" .
"β° Completed: " . date('d M Y, h:i A') . "\n\n" .
"π± *OPTI SLIP - Eye Clinic Management*";
}
/**
* Order Status Update WhatsApp Template
*/
public static function orderStatusUpdate($order_id, $customer_name, $old_status, $new_status) {
$emoji = '';
switch($new_status) {
case 'In Progress': $emoji = 'π'; break;
case 'Completed': $emoji = 'β
'; break;
case 'Cancelled': $emoji = 'β'; break;
case 'On Hold': $emoji = 'βΈοΈ'; break;
default: $emoji = 'π';
}
return "$emoji *ORDER STATUS UPDATE!*\n\n" .
"π *Order Details:*\n" .
"π Order ID: *#$order_id*\n" .
"π€ Customer: *$customer_name*\n" .
"π Status: *$old_status* β *$new_status*\n\n" .
"β° Updated: " . date('d M Y, h:i A') . "\n\n" .
"π± *OPTI SLIP - Eye Clinic Management*";
}
/**
* Daily Summary WhatsApp Template
*/
public static function dailySummary($total_orders, $total_amount, $pending_orders) {
return "π *DAILY SUMMARY*\n\n" .
"π
Date: *" . date('d M Y') . "*\n\n" .
"π *Today's Performance:*\n" .
"π¦ Total Orders: *$total_orders*\n" .
"π° Total Amount: *PKR $total_amount*\n" .
"β³ Pending Orders: *$pending_orders*\n\n" .
"π± *OPTI SLIP - Eye Clinic Management*";
}
/**
* Customer Order Confirmation WhatsApp Template
*/
public static function customerOrderConfirmation($order_id, $customer_name, $total_amount, $delivery_date = null) {
$delivery_info = $delivery_date ? "\nπ Delivery Date: *" . date('d M Y', strtotime($delivery_date)) . "*" : "";
return "π Hello *$customer_name*!\n\n" .
"β
Your order has been confirmed.\n\n" .
"π *Order Details:*\n" .
"π Order ID: *#$order_id*\n" .
"π° Amount: *PKR $total_amount*\n" .
"π Status: *Confirmed*$delivery_info\n\n" .
"π For any queries, contact us.\n" .
"Thank you for choosing us! π\n\n" .
"π± *OPTI SLIP - Eye Clinic*";
}
}
/**
* SMS Templates
*/
class SMSTemplates {
/**
* New Order SMS Template
*/
public static function newOrder($order_id, $customer_name, $total_amount) {
return "π NEW ORDER ALERT!\n\n" .
"Order ID: #$order_id\n" .
"Customer: $customer_name\n" .
"Amount: PKR $total_amount\n" .
"Status: New Order\n\n" .
"π± OPTI SLIP - Eye Clinic Management";
}
/**
* Order Completed SMS Template
*/
public static function orderCompleted($order_id, $customer_name, $total_amount) {
return "β
ORDER COMPLETED!\n\n" .
"Order ID: #$order_id\n" .
"Customer: $customer_name\n" .
"Amount: PKR $total_amount\n" .
"Status: Completed\n\n" .
"π± OPTI SLIP - Eye Clinic Management";
}
/**
* Order Status Update SMS Template
*/
public static function orderStatusUpdate($order_id, $customer_name, $old_status, $new_status) {
return "π ORDER STATUS UPDATE!\n\n" .
"Order ID: #$order_id\n" .
"Customer: $customer_name\n" .
"Status: $old_status β $new_status\n\n" .
"π± OPTI SLIP - Eye Clinic Management";
}
/**
* Daily Summary SMS Template
*/
public static function dailySummary($total_orders, $total_amount, $pending_orders) {
return "π DAILY SUMMARY\n\n" .
"Total Orders: $total_orders\n" .
"Total Amount: PKR $total_amount\n" .
"Pending Orders: $pending_orders\n\n" .
"π± OPTI SLIP - Eye Clinic Management";
}
}
?>