Download the PHP package headsnet/sms-bundle without Composer
On this page you can find all versions of the php package headsnet/sms-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download headsnet/sms-bundle
More information about headsnet/sms-bundle
Files in headsnet/sms-bundle
Package sms-bundle
Short Description Provide email and SMS sending functions
License MIT
Informations about the package sms-bundle
Symfony SMS Bundle
Symfony bundle to send and receive SMS messages. Currently only the Esendex SMS gateway is supported - https://www.esendex.com/. Other gateways may be added in the future.
Greatly inspired by the excellent tomazahlin/symfony-mailer-bundle
https://github.com/tomazahlin/symfony-mailer-bundle
Installation
Requires Symfony >= 3.3 and PHP >= 7.0
Install with Composer
composer require headsnet/sms-bundle
Add bundle to AppKernel.php
If you need to receive SMS then add the routing configuration in app/config/routing.yml
Configuration
Add required configuration in app/config.yml
To simulate SMS sending, you can use the DummyDispatcher
- for example in your when
running your test suite - add the following to app/config_test.yml
To override the recipient phone number, for example in development, add the following
to app/config_dev.yml
Define SMS message templates
Create a mapping service to link template path definitions to template names
Sending SMS
To send SMS, inject the SMS sender service in to your code. From here you can access the SMS message factory, or the SMS sender
Setting up Push Notifications
If you want the EsendexEventDispatcher gateway to phone home with delivery notifications etc, you must
ensure you have added the bundle's routing in your routing.yml
file.
Then, in your EsendexEventDispatcher control panel, configure the Push Notifications routes with the following URLs:
SMS received
https://app.your-domain.com/sms/esendex/message-received
SMS delivered
https://app.your-domain.com/sms/esendex/delivery-notify
SMS failed
https://app.your-domain.com/sms/esendex/delivery-error
Opt-out
https://app.your-domain.com/sms/esendex/opt-out
These end-points will receive the payload from EsendexEventDispatcher and dispatch one of the following events:
- headsnet.sms.delivered
- headsnet.sms.error
- headsnet.sms.received
- headsnet.sms.opt_out
Listeners to these events will receive a Headsnet\SmsBundle\Event\SmsEvent
instance which contains the message data.
View an example Event Subscriber for these events.
Contributing
Pull requests and other contributions are very welcome.
All versions of sms-bundle with dependencies
esendex/sdk Version 1.*
misd/phone-number-bundle Version ^1.2
symfony/framework-bundle Version ~3.3 || ~4.0
twig/twig Version ^2.0