_decodeProperties($_smarty_tpl, array ( 'version' => '4.3.1', 'unifunc' => 'content_6943ff6fd5d153_35327245', 'has_nocache_code' => false, 'file_dependency' => array ( '1870870741ab42d31e133a8aee62a5607308152f' => array ( 0 => '/var/www/html/yatmack/ui/ui/app-notifications.tpl', 1 => 1758106956, 2 => 'file', ), ), 'includes' => array ( 'file:sections/header.tpl' => 1, 'file:sections/footer.tpl' => 1, ), ),false)) { function content_6943ff6fd5d153_35327245 (Smarty_Internal_Template $_smarty_tpl) { $_smarty_tpl->_subTemplateRender("file:sections/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false); ?> > let currentTestType = ''; let currentPlanType = ''; function testNotification(type, planType) { currentTestType = type; currentPlanType = planType; // Update modal title document.getElementById('testNotificationModalLabel').textContent = 'Test ' + type.replace('_', ' ').toUpperCase() + ' - ' + planType.toUpperCase(); // Show modal $('#testNotificationModal').modal('show'); // Update preview updateMessagePreview(); } function updateMessagePreview() { const customerName = document.getElementById('testCustomerName').value || 'John Doe'; const packageName = document.getElementById('testPackageName').value || 'Premium 10Mbps'; const price = document.getElementById('testPrice').value || '5000'; // Get the template from the form let template = ''; if (currentTestType === 'expired') { if (currentPlanType === 'hotspot') { template = document.getElementById('expired_hotspot').value; } else { template = document.getElementById('expired_pppoe').value; } } else if (currentTestType === 'reminder_7_day') { if (currentPlanType === 'hotspot') { template = document.getElementById('reminder_7_day_hotspot').value; } else { template = document.getElementById('reminder_7_day_pppoe').value; } } // Replace variables let preview = template .replace(/\[\[name\]\]/g, customerName) .replace(/\[\[username\]\]/g, 'testuser') .replace(/\[\[package\]\]/g, packageName) .replace(/\[\[plan\]\]/g, packageName) .replace(/\[\[price\]\]/g, price) .replace(/\[\[plan_type\]\]/g, currentPlanType.toUpperCase()) .replace(/\[\[service_portal\]\]/g, 'https://portal.example.com') .replace(/\[\[support_contact\]\]/g, 'support@example.com') .replace(/\[\[expired_date\]\]/g, new Date().toLocaleDateString()) .replace(/\[\[bills\]\]/g, ''); document.getElementById('messagePreview').textContent = preview; } function sendTestNotification() { const phone = document.getElementById('testPhone').value; const customerName = document.getElementById('testCustomerName').value; const packageName = document.getElementById('testPackageName').value; const price = document.getElementById('testPrice').value; const notificationType = document.getElementById('testNotificationType').value; if (!phone) { alert('Please enter a phone number'); return; } // Show loading const sendBtn = document.querySelector('#testNotificationModal .btn-primary'); const originalText = sendBtn.textContent; sendBtn.textContent = 'Sending...'; sendBtn.disabled = true; // Send test notification fetch('tpl_vars['_url']->value;?> settings/test-notification', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: new URLSearchParams({ phone: phone, customer_name: customerName, package_name: packageName, price: price, notification_type: notificationType, test_type: currentTestType, plan_type: currentPlanType }) }) .then(response => response.text()) .then(data => { alert('Test notification sent!\nResult: ' + data); $('#testNotificationModal').modal('hide'); }) .catch(error => { alert('Error sending test notification: ' + error); }) .finally(() => { sendBtn.textContent = originalText; sendBtn.disabled = false; }); } // Update preview when form fields change document.addEventListener('DOMContentLoaded', function() { const formFields = ['testCustomerName', 'testPackageName', 'testPrice']; formFields.forEach(fieldId => { const field = document.getElementById(fieldId); if (field) { field.addEventListener('input', updateMessagePreview); } }); }); function testCronJob() { const resultDiv = document.getElementById('cronTestResult'); resultDiv.innerHTML = ' Testing cron job...'; fetch('tpl_vars['_url']->value;?> settings/test-cron', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', } }) .then(response => response.text()) .then(data => { resultDiv.innerHTML = '
' + data + '
'; }) .catch(error => { resultDiv.innerHTML = '
Error: ' + error + '
'; }); } >
> function autoExpand(element) { element.style.height = 'auto'; element.style.height = (element.scrollHeight) + 'px'; } >

[[name]] Customer Name | [[username]] Customer username | [[package]] Package name | [[price]] Package price | [[plan_type]] Service type (Hotspot/PPPoE) | [[service_portal]] Hotspot portal URL | [[support_contact]] Support contact | [[expired_date]] Expiration date | [[bills]] Additional bills

[[name]] Customer Name | [[username]] Customer username | [[package]] Package name | [[price]] Package price | [[expired_date]] Expiration date | [[service_portal]] Hotspot portal URL | [[support_contact]] Support contact | [[bills]] Additional bills

[[name]] Customer Name | [[username]] Customer username | [[package]] Package name | [[price]] Package price | [[expired_date]] Expiration date | [[service_portal]] Hotspot portal URL | [[support_contact]] Support contact | [[bills]] Additional bills

[[name]] Customer Name | [[username]] Customer username | [[package]] Package name | [[price]] Package price | [[expired_date]] Expiration date | [[service_portal]] Hotspot portal URL | [[support_contact]] Support contact | [[bills]] Additional bills


Debug Information
Troubleshooting Expiry Messages

If expiry messages are not working, check the following:

  • Cron Job: Ensure cron jobs are running: php system/cron.php
  • Notification Settings: Check that "Expired Notification" is enabled in App Settings
  • SMS/WhatsApp Configuration: Verify SMS/WhatsApp settings are properly configured
  • Phone Numbers: Ensure customers have valid phone numbers in their profiles
  • Plan Type Detection: Check that plans have correct 'type' field (Hotspot/PPPOE)
Current Notification Settings:
Expired: tpl_vars['_c']->value['user_notification_expired'] ?? null)===null||$tmp==='' ? 'Not Set' ?? null : $tmp);?>
Reminder: tpl_vars['_c']->value['user_notification_reminder'] ?? null)===null||$tmp==='' ? 'Not Set' ?? null : $tmp);?>
SMS URL: tpl_vars['_c']->value['sms_url'] ?? null)===null||$tmp==='' ? 'Not Set' ?? null : $tmp);?>
WhatsApp URL: tpl_vars['_c']->value['wa_url'] ?? null)===null||$tmp==='' ? 'Not Set' ?? null : $tmp);?>
Test Cron Job:

[[company_name]] Your Company Name at Settings. [[address]] Your Company Address at Settings. [[phone]] Your Company Phone at Settings. [[invoice]] invoice number. [[date]] Date invoice created. [[payment_gateway]] Payment gateway user paid from. [[payment_channel]] Payment channel user paid from. [[type]] is Hotspot/PPPOE. [[plan_name]] Internet Package. [[plan_price]] Internet Package Prices. [[name]] Receiver name. [[user_name]] Username internet. [[user_password]] User password. [[expired_date]] Expired datetime. [[footer]] Invoice Footer. [[note]] For Notes by admin.

[[company_name]] Your Company Name at Settings. [[address]] Your Company Address at Settings. [[phone]] Your Company Phone at Settings. [[invoice]] invoice number. [[date]] Date invoice created. [[payment_gateway]] Payment gateway user paid from. [[payment_channel]] Payment channel user paid from. [[type]] is Hotspot/PPPOE. [[plan_name]] Internet Package. [[plan_price]] Internet Package Prices. [[name]] Receiver name. [[user_name]] Username internet. [[user_password]] User password. [[trx_date]] Transaction datetime. [[balance_before]] Balance Before. [[balance]] Balance After. [[footer]] Invoice Footer.

tpl_vars['_c']->value['enable_balance'] == 'yes') {?>

[[name]] Receiver name. [[balance]] how much balance have been send. [[current_balance]] Current Balance.

[[name]] Sender name. [[balance]] how much balance have been received. [[current_balance]] Current Balance.


[[company_name]] Your Company Name from Settings. [[name]] Customer's full name. [[user_name]] Customer's username. [[username]] Customer's username (alternative). [[password]] Customer's password. [[service_type]] Service type (Hotspot/PPPOE). [[footer]] Company footer message.


_subTemplateRender("file:sections/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false); } }