Auto-Update Credit After Sending
Automatically refresh SMS credit balance after each message.
Keep your SMS credit balance synchronized by automatically refreshing it after each message is sent.
Implementation
Add this code to your theme’s functions.php or a custom plugin:
add_action('wp_sms_send', function () {
\WP_SMS\Gateway::credit();
});
How It Works
- The
wp_sms_sendhook fires after each SMS is sent \WP_SMS\Gateway::credit()queries your gateway for the current balance- Your dashboard displays the updated credit without manual refresh
Benefits
- Real-time credit balance updates
- No manual refresh required
- Always accurate remaining credits
- Better budget monitoring
Related
- wp_sms_send - Action hook reference
- Gateway Configuration - Configure SMS gateway
Last updated: December 28, 2025