How Bookboost Validates Phone Numbers
At Bookboost, ensuring the accuracy of phone numbers in guest profiles is essential. Valid phone numbers are crucial for our ability to send WhatsApp and SMS messages or campaigns effectively. This article explains how we validate phone numbers using an external tool to maintain our high standards of communication.
Understanding Phone Validation
Our phone number validation involves a two-step process:
- Initial Validation:
- The phone number is first checked in its raw format (e.g., "015223433253") using an external tool called Laravel Phone.
- If this initial validation fails, the phone number is marked as invalid.
- Country Code Inclusion:
- If the initial validation fails, the process includes a country code (e.g., "DE" for Germany) with the raw number. We typically extract the country code from the guest's address.
- If there is no address provided or the inclusion of the country code does not validate the number, it is set as invalid.
Why We Use External Tools
Bookboost does not internally determine the validity of a phone number. Instead, we rely on the Laravel Phone package, which acts as a wrapper for libphonenumber. By utilizing an external provider, Bookboost ensures that all phone numbers in your guest profiles are validated accurately, which is crucial for our communication strategies. This process helps us maintain effective and reliable communication with your guests.
- Our role is to prepare the phone number for validation. For instance, a raw number like "+66 +66 0891234567" would be simplified by removing the repeated country code to ensure the number is processed correctly by Laravel Phone.