Skip to content

[fix] Regional.py: (#88) fixes local to intl mobile_no handling#89

Merged
SaiFi0102 merged 2 commits intoParaLogicTech:version-15from
PavanKumarPacharla:twilio_wa_integration
Apr 29, 2025
Merged

[fix] Regional.py: (#88) fixes local to intl mobile_no handling#89
SaiFi0102 merged 2 commits intoParaLogicTech:version-15from
PavanKumarPacharla:twilio_wa_integration

Conversation

@PavanKumarPacharla
Copy link
Copy Markdown

Pull Request: Fix Automatic '+' Prefix in Mobile Number Handling for WhatsApp Integration

This pull request addresses an issue in the WhatsApp integration for ERPNext using Twilio, where the mobile number handling logic automatically prepends a '+' to all mobile numbers. This behavior caused inconsistencies when processing local and international mobile numbers. The fix ensures that the '+' prefix is only added when necessary, based on the number format and country code, improving reliability for both local and international numbers.

Changes Made

  • Modified the mobile number parsing logic to check for existing '+' prefixes before adding one.
  • Added validation to handle local numbers without automatically prepending '+' unless required for international formatting.
  • Ensured compatibility with Twilio's expected number format for WhatsApp messaging.
    • Add '+' only if it's not already present.
    • Ensure the final format adheres to Twilio's international number standards.

Why This is Needed

Twilio expects phone numbers in the correct E.164 format. Adding an extra '+' led to message delivery failures. This fix ensures numbers are properly formatted before being passed to Twilio.

Testing

  • Verified with both local and international number formats.
  • Ensured messages were successfully delivered via Twilio after the fix.

Related Issues

Closes:

…er starts with 00 to + in local to intl mobile-no handling
@SaiFi0102 SaiFi0102 merged commit dcd0ceb into ParaLogicTech:version-15 Apr 29, 2025
8 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: WhatsApp Twilio Integration (Outbound only)

2 participants