All Projects → fridolin-koch → VreshTwilioBundle

fridolin-koch / VreshTwilioBundle

Licence: MIT license
A Symfony2 wrapper for the official SDK provided by Twilio.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to VreshTwilioBundle

guzzle6-bundle
Integrates Guzzle 6 into your Symfony application
Stars: ✭ 11 (-75.56%)
Mutual labels:  bundle, symfony-bundle
DynamicParametersBundle
[UNMAINTAINED] Runtime retrieval of parameters from environment variables for Symfony
Stars: ✭ 42 (-6.67%)
Mutual labels:  bundle, symfony-bundle
wordpress-bundle
Use Wordpress and Symfony together using a Symfony bundle
Stars: ✭ 30 (-33.33%)
Mutual labels:  bundle, symfony-bundle
socketio
No description or website provided.
Stars: ✭ 23 (-48.89%)
Mutual labels:  bundle, symfony-bundle
vite-bundle
Integration with your Symfony app & Vite
Stars: ✭ 56 (+24.44%)
Mutual labels:  bundle, symfony-bundle
OpcacheBundle
Displays the PHP OPcache status in the Symfony profiler toolbar.
Stars: ✭ 21 (-53.33%)
Mutual labels:  bundle, symfony-bundle
SonataFormatterBundle
Symfony SonataFormatterBundle
Stars: ✭ 78 (+73.33%)
Mutual labels:  bundle, symfony-bundle
breadcrumb-bundle
Symfony bundle for easy breadcrumbs management
Stars: ✭ 26 (-42.22%)
Mutual labels:  bundle, symfony-bundle
LexikMailerBundle
This Symfony2 bundle allow you to manage some HTML email templates stored in your database. Templates are written with Twig and use I18N. You can also create some layouts to decorate your email.
Stars: ✭ 81 (+80%)
Mutual labels:  bundle, symfony-bundle
SinchBundle
📦 Provides integration with Sinch.com SMS API.
Stars: ✭ 12 (-73.33%)
Mutual labels:  bundle, symfony-bundle
lexik-jose-bridge
An Encoder for the LexikJWTAuthenticationBundle that uses web-token/jwt-framework
Stars: ✭ 27 (-40%)
Mutual labels:  bundle, symfony-bundle
FCMBundle
A Bundle for Symfony projects to send notifications in mobile devices through Firebase Cloud Messaging API
Stars: ✭ 43 (-4.44%)
Mutual labels:  bundle, symfony-bundle
BeelabTagBundle
🏷 A simple implementation of tags for Symfony and Doctrine ORM
Stars: ✭ 45 (+0%)
Mutual labels:  bundle, symfony-bundle
KtwDatabaseMenuBundle
Symfony bundle for extending KnpMenu to store menu items in a database.
Stars: ✭ 12 (-73.33%)
Mutual labels:  bundle, symfony-bundle
awsBundle
Symfony AWS Bundle (supports Symfony 2, 3 and 4)
Stars: ✭ 18 (-60%)
Mutual labels:  bundle, symfony-bundle
FkrCssURLRewriteBundle
A small assetic filter for symfony to fix all url paths at css documents to correct urls
Stars: ✭ 33 (-26.67%)
Mutual labels:  bundle, symfony-bundle
NucleosDompdfBundle
📜 This bundle provides a wrapper for using dompdf inside symfony.
Stars: ✭ 29 (-35.56%)
Mutual labels:  bundle, symfony-bundle
LiipSoapRecorderBundle
[DEPRECATED] Recorder/Player for SOAP communications
Stars: ✭ 12 (-73.33%)
Mutual labels:  bundle, symfony-bundle
AtoumBundle
This bundle provides a simple integration of atoum into Symfony 2.
Stars: ✭ 44 (-2.22%)
Mutual labels:  bundle, symfony-bundle
supervisor-bundle
Easily update your @Supervisor configuration by using annotations in Symfony commands.
Stars: ✭ 35 (-22.22%)
Mutual labels:  bundle, symfony-bundle

#Symfony2 Twilio Bundle - by Fridolin Koch

Build Status

Coverage Status

Scrutinizer Code Quality

About

This is just a wrapper for the official SDK provided by Twilio.

Installation

Add this to your composer.json file:

"require": {
	"vresh/twilio-bundle": "dev-master",
}

Add the bundle to app/AppKernel.php

$bundles = array(
	// ... other bundles
	new Vresh\TwilioBundle\VreshTwilioBundle(),
);

Configuration

Add this to your config.yml:

vresh_twilio:
    #(Required) Your Account SID from www.twilio.com/user/account
    sid: 'XXXXXXXX'
    #(Required) Your Auth Token from www.twilio.com/user/account
    authToken: 'YYYYYYYY'
    #(Optional, default: '2010-04-01') Twilio API version
    version: '2010-04-01'
    #(Optional, default: 1) Number of times to retry failed requests
    retryAttempts: 3

Usage

Provided services:

Service Class
twilio.api \Services_Twilio
twilio.capability \Services_Twilio_Capability
twilio.lookups \Lookups_Services_Twilio

Inside a controller:

class TelephoneController extends Controller
{
    public function callAction($me, $maybee)
    {
        //returns an instance of Vresh\TwilioBundle\Service\TwilioWrapper
    	$twilio = $this->get('twilio.api');

        $message = $twilio->account->messages->sendMessage(
	  '+14085551234', // From a Twilio number in your account
	  '+12125551234', // Text any number
	  "Hello monkey!"
	);

        //get an instance of \Service_Twilio
        $otherInstance = $twilio->createInstance('BBBB', 'CCCCC');

        return new Response($message->sid);
    }
}

Inside a console command:

class SomeCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this
            ->setName('some:comand')
            ->setDescription('A command')
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        //returns an instance of Vresh\TwilioBundle\Service\TwilioWrapper
        $twilio = $this->getContainer()->get('twilio.api');

        $message = $twilio->account->messages->sendMessage(
	  '+14085551234', // From a Twilio number in your account
	  '+12125551234', // Text any number
	  "Hello monkey!"
	);

        //get an instance of \Service_Twilio
        $otherInstance = $twilio->createInstance('BBBB', 'CCCCC');

        print $message->sid;

    }
}

Copyright / License

See LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].