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

  1. The wp_sms_send hook fires after each SMS is sent
  2. \WP_SMS\Gateway::credit() queries your gateway for the current balance
  3. 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

Last updated: December 28, 2025