Skip to main content

Basic Usage

Configuration

SMS Providers

Industry-leading SMS provider with 99.95% uptime and global coverage:
Setup:
  1. Sign up at twilio.com
  2. Get Account SID and Auth Token from console
  3. Purchase a phone number or create Messaging Service
  4. Set secrets:
Pricing:
  • US/Canada: $0.0079/SMS
  • UK: $0.04/SMS
  • India: $0.0057/SMS
  • Full pricing
Rate Limits:
  • Standard: 100 SMS/second
  • Messaging Service: 1,000 SMS/second
  • Free trial: 1 SMS/second

Vonage (formerly Nexmo)

Cost-effective SMS with strong international coverage:
Setup:
  1. Sign up at vonage.com
  2. Get API Key and Secret
  3. Set secrets:
Pricing:
  • US: $0.0057/SMS
  • UK: $0.0331/SMS
  • Lower than Twilio in many regions

AWS SNS

Integrate with AWS infrastructure:
Setup:
  1. Enable SNS in AWS Console
  2. Create IAM user with SNS permissions
  3. Set secrets:

Phone Number Format

All phone numbers MUST use E.164 format:
Valid Examples:
  • US: +1234567890
  • UK: +442071234567
  • France: +33123456789
  • Japan: +81312345678
  • India: +919876543210
Invalid Examples (will be rejected):
  • 1234567890 - Missing + prefix
  • +1 (234) 567-8900 - Contains formatting
  • +1-234-567-8900 - Contains dashes
  • 001-234-567-8900 - Wrong prefix

Common Use Cases

OTP Verification

System Alerts

Order Notifications

Appointment Reminders

Batch Sending

Send personalized SMS to multiple recipients:
Output:

MMS (Multimedia Messages)

Send images and media with Twilio:
Supported Media:
  • Images: JPG, PNG, GIF
  • Video: MP4, 3GP
  • Audio: MP3, WAV
  • Documents: PDF
  • Max size: 5 MB per file
  • Max files: 10 per message
MMS Pricing:
  • US/Canada: 0.02/MMS(vs0.02/MMS (vs 0.0079/SMS)
  • International: Varies by country

Template Rendering

Use Liquid templates for dynamic content:

Rate Limiting

Control sending rate to respect provider limits:
Recommended Rates:
  • Twilio Free Trial: 1 SMS/sec
  • Twilio Standard: 10 SMS/sec
  • Twilio Messaging Service: 100 SMS/sec
  • Vonage: 10 SMS/sec
  • AWS SNS: 20 SMS/sec

Error Handling

Retry on Failure

Fallback Provider

Validate Phone Numbers

Testing

Test with TestConductor

Mock SMS Provider

Best Practices

1. Keep Messages Short
2. Include Opt-Out Instructions
3. Validate Before Sending
5. Store Credentials Securely
6. Use Messaging Services for Scale
7. Monitor Delivery Status
8. Respect Time Zones

Pitfall: Too Long Messages

Pitfall: No Error Handling

Pitfall: Missing Opt-Out

SMS vs Email Comparison

Troubleshooting

SMS Not Delivering

  1. Verify phone format - Must be E.164 (+1234567890)
  2. Check provider credentials - Ensure Account SID/Auth Token correct
  3. Review rate limits - You may be hitting throttles
  4. Check provider console - View delivery reports
  5. Test with own number - Confirm basic functionality

Rate Limit Errors

Invalid Phone Number Errors

Message Too Long

  • Single SMS: 160 chars (GSM-7) or 70 chars (Unicode)
  • Concatenated SMS: Up to 1600 chars (10 segments)
  • Cost: Each segment charged separately
  • Solution: Shorten message or use link shorteners

Next Steps

email Operation

Compare with email

storage Operation

Store OTP codes

code Operation

Generate verification codes

Testing

Test SMS workflows