Magic Login allows users to authenticate securely using one-time passwords (OTPs) sent via SMS. This integration uses Twilio to send login codes via SMS. Follow the steps below to set up Twilio for Magic Login.
📌 Prerequisites #
Before integrating Twilio with Magic Login, ensure you have:
- A Twilio Account (Sign up at Twilio).
- A Twilio phone number capable of sending SMS.
- Magic Login PRO installed on your WordPress website.
Step 1: Create a Twilio Account #
- Go to Twilio’s Sign-Up Page.
- Fill in the required details and verify your email.
- Complete phone number verification.
- Select Twilio (SMS, Voice, Verify, Lookup) as the usage type.
Step 2: Purchase a Twilio Phone Number #
To send SMS messages, you need to buy a Twilio phone number.
- In the Twilio dashboard, go to Phone Numbers > Buy a Number.
- Select a country and ensure the number supports SMS.
- Click Buy to purchase the selected number.
Step 3: Get Your Twilio API Credentials #
- Once logged into Twilio, navigate to the Account Dashboard.
- Copy the following credentials:
- Account SID
- Auth Token
- Twilio Phone Number
Step 4: Configure Twilio in Magic Login #
- Go to your WordPress Dashboard.
- Navigate to Magic Login > Settings > SMS.
- Enter the Twilio credentials:
- Account SID
- Auth Token
- From (Your Twilio phone number)
- Click Save Changes.
Step 5: Test SMS Sending #
- Click the Send a Test SMS button in Magic Login settings.
- Enter a test phone number and check if the message is received.
✅ Troubleshooting #
- SMS Not Sending?
- Ensure your Twilio trial account is upgraded (trial accounts only send messages to verified numbers).
- Check if your Twilio phone number has SMS capability.
- Verify the Auth Token and Account SID are correct.
- Invalid From Number?
- Ensure you’re using a Twilio-provided phone number.
- Geographic Permissions
If you are not getting the SMS, make sure your messaging settings on Twilio dashboard. You might need to select your country to get SMS: