Download the PHP package tourze/jiguang-sms-bundle without Composer
On this page you can find all versions of the php package tourze/jiguang-sms-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package jiguang-sms-bundle
JiguangSmsBundle
中文
A Symfony bundle that integrates Jiguang (JPush) SMS service, providing SMS sending, signature management, template management, and verification code capabilities.
Table of Contents
- Features
- Installation
- Configuration
- Quick Start
- Basic SMS Sending
- Verification Code
- Available Commands
- Account Balance Synchronization
- Message Status Synchronization
- Verification Code Status Synchronization
- Signature Status Synchronization
- Template Status Synchronization
- Advanced Usage
- Custom Request Handlers
- Event Listeners
- Security
- Credentials Management
- Rate Limiting
- Input Validation
- Entities
- Services
- Requirements
- Contributing
- License
Features
- 📱 SMS message sending with template support
- 🔐 Text and voice verification code generation
- 📋 SMS template management with status synchronization
- ✏️ SMS signature management with status tracking
- 💰 Account balance monitoring
- 📊 Message delivery status tracking
- ⚡ Automated synchronization via cron jobs
- 🎯 Full Doctrine ORM integration
Installation
Configuration
Configure your Jiguang SMS credentials in your Symfony application:
Database Setup
The bundle requires database tables to store SMS data. Run the following commands to create them:
Bundle Registration
If you're not using Symfony Flex, manually register the bundle in config/bundles.php:
Quick Start
Basic SMS Sending
Verification Code
Available Commands
The bundle provides several console commands for automated synchronization:
Account Balance Synchronization
Synchronizes account balance information from Jiguang servers. Runs automatically every 10 minutes via cron.
Message Status Synchronization
Updates delivery status for sent SMS messages. Runs automatically every 5 minutes via cron.
Verification Code Status Synchronization
Checks and updates verification status for active verification codes. Runs automatically every minute via cron.
Signature Status Synchronization
Synchronizes signature approval status with Jiguang servers. Run manually as needed.
Template Status Synchronization
Updates template approval status from Jiguang servers. Run manually as needed.
Note: The cron jobs are automatically configured using the
tourze/symfony-cron-job-bundle. Make sure your application has proper cron job scheduling set up.
Advanced Usage
Template and Signature Management
The bundle provides services for managing SMS templates and signatures:
Custom Request Handlers
You can create custom request handlers for specialized SMS operations:
Event Listeners
The bundle provides event subscribers for automatic processing:
Error Handling
The bundle provides specific exception types for error handling:
Security
Credentials Management
- Store your Jiguang SMS credentials securely using environment variables
- Never commit credentials to version control
- Use Symfony's secrets management for production environments
Rate Limiting
Implement rate limiting to prevent abuse:
Input Validation
Always validate phone numbers and message content:
Entities
The bundle provides the following Doctrine entities:
Core Entities
Account- Jiguang SMS account credentials and configurationMessage- SMS message records with delivery statusTextCode/VoiceCode- Verification code records with verification statusSign- SMS signature management with approval statusTemplate- SMS template management with approval statusAccountBalance- Account balance tracking for different SMS types
Entity Relationships
Entity Features
- Timestampable: Automatic created_at and updated_at timestamps
- Blameable: Automatic user tracking for create/update operations
- Trackable: Field-level change tracking
- Indexed: Optimized database indexes for performance
Services
Core Services
JiguangSmsService- Main API client for Jiguang SMS communicationSignService- Signature management operations (create, update, delete, sync)TemplateService- Template management operations (create, update, delete, sync)
Repository Services
AccountRepository- Account entity repositoryMessageRepository- Message entity repositoryTextCodeRepository/VoiceCodeRepository- Verification code repositoriesSignRepository- Signature entity repositoryTemplateRepository- Template entity repositoryAccountBalanceRepository- Account balance repository
Service Features
- Automatic dependency injection via Symfony DI
- Error handling with specific exception types
- Built-in retry mechanisms for network operations
- Comprehensive logging support
Requirements
- PHP 8.1 or higher
- Symfony 6.4 or higher
- Doctrine ORM 3.0 or higher
- ext-mbstring (for multi-byte string handling)
Troubleshooting
Common Issues
1. "Account not found" error
2. "Invalid signature" error
3. Database connection issues
4. Cron jobs not running
Debugging
Enable debug mode to see detailed API requests:
Performance Optimization
For high-volume SMS sending, consider:
- Batch Processing: Use queues for bulk SMS operations
- Connection Pooling: Configure HTTP client with connection pooling
- Caching: Cache frequently accessed account data
- Rate Limiting: Implement rate limiting to avoid API limits
Contributing
Please see CONTRIBUTING.md for details.
License
The MIT License (MIT). Please see License File for more information.
All versions of jiguang-sms-bundle with dependencies
doctrine/doctrine-bundle Version ^2.13
symfony/framework-bundle Version ^6.4
tourze/easy-admin-attribute Version 0.0.*
tourze/doctrine-indexed-bundle Version 0.0.*
tourze/doctrine-track-bundle Version 0.0.*
tourze/doctrine-timestamp-bundle Version 0.0.*
tourze/doctrine-user-bundle Version 0.0.*
tourze/http-client-bundle Version 0.0.*
tourze/symfony-cron-job-bundle Version 0.0.*
yiisoft/json Version ^1.0