sms77 / krayin
Requires
- php: ^7.4|^8.0
- ext-json: *
- krayin/laravel-crm: ^1.0
This package is auto-updated.
Last update: 2025-08-07 12:53:45 UTC
README
seven SMS Integration for Krayin CRM
Seamlessly integrate SMS functionality into your Krayin CRM with seven's powerful messaging API. Send individual and bulk SMS messages directly from your CRM interface.
📋 Table of Contents
- Features
- Requirements
- Installation
- Configuration
- Usage
- Bulk SMS
- Placeholders
- Troubleshooting
- FAQ
- Support
- License
✨ Features
- Direct SMS Integration - Send SMS messages directly from person and organization records
- Bulk SMS Campaigns - Send messages to multiple contacts simultaneously
- Smart Placeholders - Personalize messages with dynamic contact information
- Performance Tracking - Monitor SMS delivery and engagement metrics
- Admin Configuration - Easy setup through Krayin's admin panel
- Environment Variables - Secure API key management
- Contact Integration - Seamlessly works with existing Krayin contacts
📦 Requirements
Component | Version |
---|---|
PHP | >= 8.0 |
Krayin CRM | v2.x |
Composer | >= 2.0 |
seven API Key | Get one here |
🚀 Installation
Step 1: Install via Composer (Recommended)
composer require seven/krayin
Step 2: Register Service Provider
Add the service provider to your config/app.php
:
<?php return [ // ... 'providers' => [ // ... Seven\Krayin\Providers\SevenServiceProvider::class, ], // ... ];
Step 3: Configure Autoloading
Add the package namespace to your composer.json
:
{ "autoload": { "psr-4": { "Seven\\Krayin\\": "packages/Seven/Krayin/src" } } }
Step 4: Run Migrations
# Clear cache php artisan cache:clear # Run database migrations php artisan migrate # Regenerate autoload files composer dump-autoload
⚙️ Configuration
You can configure the seven SMS integration in two ways:
Option 1: Admin Panel Configuration (Recommended)
- Navigate to Dashboard → Configuration → seven in your Krayin admin panel
- Enter your seven API Key
- Click Save to apply the configuration
Option 2: Environment Variables
- Add your API key to the
.env
file:
SEVEN_API_KEY=YourSuperSecretApiKeyFromSeven
- Update
config/services.php
:
return [ // ... 'seven' => [ 'api_key' => env('SEVEN_API_KEY'), ], ];
- Clear and cache configuration:
php artisan cache:clear && php artisan config:cache
Note: Admin panel configuration takes precedence over environment variables.
📱 Usage
Send SMS to Individual Contacts
For Persons
- Navigate to Contacts → Persons
- Find the person you want to message
- Click the seven icon in the actions column
- Compose and send your message
For Organizations
- Navigate to Contacts → Organizations
- Find the organization you want to message
- Click the seven icon in the actions column
- Compose and send your message
Example: Programmatic SMS Sending
use Seven\Krayin\Services\SmsService; $smsService = app(SmsService::class); // Send SMS to a contact $smsService->send( to: '+1234567890', message: 'Hello {{name}}, your appointment is confirmed!', contactId: $contact->id );
📨 Bulk SMS
Send SMS campaigns to multiple contacts at once:
- Navigate to Contacts → Persons or Organizations
- Select multiple contacts using checkboxes
- Click Bulk Actions → Send SMS
- Compose your message with placeholders
- Review and send
Bulk SMS Best Practices
- Test with a small group first
- Use placeholders for personalization
- Monitor delivery reports
- Respect sending limits and regulations
- Schedule campaigns during appropriate hours
🔤 Placeholders
Personalize your messages with dynamic placeholders:
Placeholder | Description | Example Output |
---|---|---|
{{name}} |
Contact's full name | John Doe |
{{first_name}} |
First name only | John |
{{last_name}} |
Last name only | Doe |
{{organization}} |
Organization name | Acme Corp |
{{email}} |
Email address | john@example.com |
{{phone}} |
Phone number | +1234567890 |
Example Message with Placeholders
Hello {{first_name}},
Your appointment at {{organization}} is confirmed for tomorrow at 2 PM.
Best regards,
Your CRM Team
🔧 Troubleshooting
Common Issues and Solutions
SMS Not Sending
- Check API Key: Verify your seven API key is correctly configured
- Phone Format: Ensure phone numbers include country code (e.g., +1234567890)
- Balance: Check your seven account has sufficient SMS credits
- Logs: Review Laravel logs at
storage/logs/laravel.log
Migration Errors
# Reset migrations if needed php artisan migrate:rollback php artisan migrate # Clear all caches php artisan cache:clear php artisan config:clear php artisan view:clear
Service Provider Not Found
# Regenerate composer autoload composer dump-autoload # Clear bootstrap cache php artisan optimize:clear
❓ FAQ
Q: Can I use SMS templates? A: Yes, you can create reusable message templates with placeholders in the admin panel.
Q: Are there sending limits? A: Limits depend on your seven account plan. Check your seven dashboard for details.
Q: Can I track SMS delivery? A: Yes, delivery reports are available in the Performance Tracking section.
Q: How do I test SMS functionality?
A: Use seven's test mode by adding test=1
parameter in your API configuration.
Q: Can I schedule SMS messages? A: Scheduled messaging is planned for a future release.
🛠️ Development
Running Tests
# Run package tests php artisan test packages/Seven/Krayin # Run with coverage php artisan test --coverage packages/Seven/Krayin
Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
📞 Support
Need help? We're here to assist!
- 📧 Email: support@seven.io
- 📚 Documentation: seven API Docs
- 💬 Contact: Contact Form
- 🐛 Issues: GitHub Issues
📄 License
This package is open-source software licensed under the MIT License.
Made with ❤️ by seven