Voicemail to SMS: Customizing Subject Line for VoIP Provider Gateway

I’m seeking assistance with a specific voicemail notification configuration in FreePBX, related to how voicemail-to-SMS works with my VoIP provider.

The Problem: My mobile carrier no longer supports the traditional email-to-SMS gateway. My VoIP provider offers a workaround: they can receive an email and convert it to an SMS, but with a specific requirement. The SMS recipient’s phone number must be specified in the subject line of the email, rather than the “To:” field. All SMS messages sent via this method are directed to a single email address within their system.

Current FreePBX Voicemail Setup: In the FreePBX GUI, under “Voicemail Admin” → “Extensions,” the voicemail settings for each extension allow me to specify a “Pager Email Address” for notifications. This puts the recipient’s email in the “To:” field of the notification email.

What I Need to Achieve: I need to find a way, within FreePBX, to configure the voicemail notification so that:

  1. The recipient’s phone number (which corresponds to the extension’s mailbox number, e.g., 5551234567 for extension 123) is placed in the subject line of the email.
  2. The “To:” email address would be the standard email address for all sms notifications.

Any advice you could provide for this would be helpful.

Thank you!

Youd have to write a script to do this and then set the mail command in settings → voicemail admin → email config