Morocco SMS Best Practices, Compliance, and Features
Morocco SMS Market Overview
Locale name: | Morocco |
---|---|
ISO code: | MA |
Region | Middle East & Africa |
Mobile country code (MCC) | 604 |
Dialing Code | +212 |
Market Conditions: Morocco has a vibrant mobile communications market with three major operators: Maroc Telecom, Orange Morocco, and Inwi (formerly Wana). SMS remains a crucial communication channel for businesses and consumers, though messaging apps like WhatsApp and Facebook Messenger are increasingly popular. Android devices dominate the market, accounting for approximately 85% of mobile devices, while iOS devices make up the remaining share.
Key SMS Features and Capabilities in Morocco
Morocco offers robust SMS capabilities with support for concatenated messages and alphanumeric sender IDs, though two-way SMS functionality is limited.
Two-way SMS Support
Two-way SMS is not supported in Morocco through most providers. This means businesses cannot receive replies to their SMS messages through standard A2P channels.
Concatenated Messages (Segmented SMS)
Support: Yes, concatenation is supported across most networks, though support may vary by sender ID type.
Message length rules: Standard SMS length of 160 characters for GSM-7 encoding, or 70 characters for Unicode (UCS-2) encoding.
Encoding considerations: Both GSM-7 and UCS-2 encodings are supported. Arabic text requires UCS-2 encoding, reducing the character limit to 70 per segment.
MMS Support
MMS messages are not directly supported in Morocco. When attempting to send MMS, the message will be automatically converted to SMS with an embedded URL link where recipients can view the multimedia content. This ensures message delivery while maintaining compatibility across all networks.
Recipient Phone Number Compatibility
Number Portability
Number portability is available in Morocco, allowing users to keep their phone numbers when switching between mobile operators. This feature does not significantly impact SMS delivery or routing as messages are properly routed to the current carrier.
Sending SMS to Landlines
Sending SMS to landline numbers is not possible in Morocco. Attempts to send messages to landline numbers will result in delivery failure, typically generating a 400 response with error code 21614. These messages will not appear in logs and accounts will not be charged for failed attempts.
Compliance and Regulatory Guidelines for SMS in Morocco
SMS communications in Morocco are regulated by the National Telecommunications Regulatory Agency (ANRT). Companies must comply with local telecommunications laws and data protection regulations, including Law 09-08 concerning the protection of individuals with regard to personal data processing.
Consent and Opt-In
Explicit Consent Requirements:
- Obtain clear, documented opt-in consent before sending marketing messages
- Maintain detailed records of when and how consent was obtained
- Include company name and purpose in consent requests
- Provide clear terms and conditions regarding message frequency and content
Best Practices for Consent Collection:
- Use double opt-in verification for marketing lists
- Document consent timestamp, source, and IP address
- Store consent records for at least 2 years
- Regular consent database maintenance and updates
HELP/STOP and Other Commands
- All SMS campaigns must support standard opt-out keywords:
- STOP, ARRET, UNSUBSCRIBE (English/French)
- توقف (Arabic)
- HELP/AIDE commands must provide service information
- Responses to commands should be in the same language as the keyword received
- All command responses must be free of charge for users
Do Not Call / Do Not Disturb Registries
Morocco does not maintain a centralized Do Not Call registry. However, businesses should:
- Maintain their own suppression lists
- Honor opt-out requests within 24 hours
- Regularly clean contact lists
- Implement automated opt-out processing
- Document all opt-out requests and processing dates
Time Zone Sensitivity
Morocco observes Western European Time (WET/GMT+1). While there are no strict legal time restrictions for SMS:
- Recommended Sending Hours: 9:00 AM to 8:00 PM local time
- Religious Considerations: Avoid sending during prayer times
- Holiday Awareness: Respect Ramadan and other religious observances
- Emergency Exception: Urgent messages may be sent outside recommended hours
Phone Numbers Options and SMS Sender Types for Morocco
Alphanumeric Sender ID
Operator network capability: Fully supported across major networks
Registration requirements: Pre-registration required, takes approximately 3 weeks
Sender ID preservation: Yes, preserved across all networks except Inwi
Character limits: Up to 11 characters, alphanumeric only
Long Codes
Domestic vs. International:
- Domestic long codes not supported
- International long codes supported but with limitations
- Numeric sender IDs not supported by Maroc Telecom and Wana Telecom
Sender ID preservation: No, international numbers may be overwritten with generic alphanumeric IDs
Use cases: Not recommended for marketing campaigns; better suited for transactional messages
Short Codes
Support: Not currently supported in Morocco
Alternative: Use pre-registered alphanumeric sender IDs instead
Restricted SMS Content, Industries, and Use Cases
Prohibited Content:
- Gambling and betting services
- Adult content or explicit material
- Political messaging without proper authorization
- Religious content
- Illegal substances or services
- Hate speech or discriminatory content
Regulated Industries:
- Financial services require additional documentation
- Healthcare messages must comply with privacy regulations
- Debt collection services face strict limitations
Content Filtering
Known Carrier Filters:
- URLs from unknown domains may be blocked
- Messages containing specific keywords related to restricted content
- Multiple exclamation marks or all-caps text
Best Practices to Avoid Filtering:
- Use registered and approved sender IDs
- Avoid URL shorteners
- Keep content professional and clear
- Use approved templates for sensitive industries
- Maintain consistent sending patterns
Best Practices for Sending SMS in Morocco
Messaging Strategy
- Keep messages under 160 characters when possible
- Include clear call-to-action
- Use personalization tokens thoughtfully
- Maintain consistent brand voice
- Include company name in message
Sending Frequency and Timing
- Limit to 4-5 messages per month per recipient
- Respect Ramadan sending hours
- Avoid sending during Friday prayers
- Space out bulk campaigns to prevent network congestion
Localization
- Support Arabic, French, and local Darija dialect
- Use appropriate character encoding for Arabic text
- Consider cultural sensitivities in content
- Offer language preference selection
Opt-Out Management
- Process opt-outs within 24 hours
- Maintain centralized opt-out database
- Include opt-out instructions in messages
- Regular audit of opt-out compliance
Testing and Monitoring
- Test across all major carriers (Maroc Telecom, Orange, Inwi)
- Monitor delivery rates by carrier
- Track opt-out rates and patterns
- Regular content and compliance audits
- A/B test message timing and content
SMS API integrations for Morocco
Twilio
Twilio provides a robust REST API for sending SMS to Morocco. Authentication uses account SID and auth token.
import { Twilio } from 'twilio';
// Initialize client with your credentials
const client = new Twilio(
process.env.TWILIO_ACCOUNT_SID,
process.env.TWILIO_AUTH_TOKEN
);
// Function to send SMS to Morocco
async function sendSMSToMorocco(
to: string,
message: string,
senderId: string
): Promise<void> {
try {
// Ensure proper formatting for Morocco numbers (+212)
const formattedNumber = to.startsWith('+212') ? to : `+212${to.slice(-9)}`;
const response = await client.messages.create({
body: message,
from: senderId, // Pre-registered alphanumeric sender ID
to: formattedNumber,
// Optional parameters for delivery tracking
statusCallback: 'https://your-webhook.com/status'
});
console.log(`Message sent successfully! SID: ${response.sid}`);
} catch (error) {
console.error('Error sending message:', error);
throw error;
}
}
Sinch
Sinch offers a straightforward REST API with JWT authentication for Morocco SMS.
import axios from 'axios';
class SinchSMSClient {
private readonly baseUrl: string;
private readonly apiToken: string;
private readonly servicePlanId: string;
constructor(servicePlanId: string, apiToken: string) {
this.baseUrl = 'https://sms.api.sinch.com/xms/v1';
this.apiToken = apiToken;
this.servicePlanId = servicePlanId;
}
async sendSMS(to: string, message: string, senderId: string): Promise<void> {
try {
const response = await axios.post(
`${this.baseUrl}/${this.servicePlanId}/batches`,
{
from: senderId,
to: [to],
body: message,
delivery_report: 'summary'
},
{
headers: {
'Authorization': `Bearer ${this.apiToken}`,
'Content-Type': 'application/json'
}
}
);
console.log('Message sent:', response.data.id);
} catch (error) {
console.error('Sinch SMS error:', error);
throw error;
}
}
}
MessageBird
MessageBird provides a feature-rich API with support for Morocco's specific requirements.
import messagebird from 'messagebird';
class MessageBirdClient {
private client: any;
constructor(apiKey: string) {
this.client = messagebird(apiKey);
}
sendSMS(
to: string,
message: string,
senderId: string
): Promise<any> {
return new Promise((resolve, reject) => {
// Configure message parameters
const params = {
originator: senderId,
recipients: [to],
body: message,
// Morocco-specific parameters
datacoding: 'unicode', // For Arabic support
type: 'premium' // For business messaging
};
this.client.messages.create(params, (err: any, response: any) => {
if (err) {
reject(err);
} else {
resolve(response);
}
});
});
}
}
Plivo
Plivo offers a reliable API with specific features for Morocco messaging.
import plivo from 'plivo';
class PlivoSMSClient {
private client: any;
constructor(authId: string, authToken: string) {
this.client = new plivo.Client(authId, authToken);
}
async sendSMS(
to: string,
message: string,
senderId: string
): Promise<void> {
try {
const response = await this.client.messages.create({
src: senderId, // Your registered sender ID
dst: to, // Destination number in E.164 format
text: message,
// Morocco-specific parameters
url_strip_domain: false, // Preserve full URLs
powerpack_id: 'your_powerpack_id' // If using Powerpack
});
console.log('Message sent:', response.messageUuid);
} catch (error) {
console.error('Plivo error:', error);
throw error;
}
}
}
API Rate Limits and Throughput
- Default rate limits vary by provider:
- Twilio: 100 messages/second
- Sinch: 30 messages/second
- MessageBird: 60 messages/second
- Plivo: 50 messages/second
Strategies for Large-Scale Sending:
- Implement queue systems (Redis/RabbitMQ)
- Use batch APIs where available
- Implement exponential backoff for retries
- Monitor throughput and adjust sending rates
Error Handling and Reporting
- Implement comprehensive logging
- Monitor delivery receipts
- Track common error codes
- Set up automated alerts for failure thresholds
- Maintain error logs for compliance
Recap and Additional Resources
Key Takeaways
-
Compliance First
- Pre-register alphanumeric sender IDs
- Maintain opt-in records
- Honor opt-out requests promptly
-
Technical Considerations
- Support Unicode for Arabic text
- Implement proper error handling
- Monitor delivery rates
-
Best Practices
- Respect local time zones
- Use appropriate language options
- Keep messages concise and relevant
Next Steps
- Review ANRT regulations at www.anrt.ma
- Consult legal counsel for compliance review
- Set up test accounts with preferred providers
- Implement delivery tracking systems
Additional Resources
-
Official Resources:
- ANRT Guidelines: www.anrt.ma/en/operators/guidelines
- Data Protection Law 09-08: www.cndp.ma
-
Industry Resources:
- MEA Mobile Operators Association
- Mobile Marketing Association MENA
-
Technical Documentation:
- Provider-specific Morocco guidelines
- SMS character encoding standards
- API integration guides