Giter Club home page Giter Club logo

laravel-letexto's Introduction

Laravel Letexto Package

Latest Version on Packagist Total Downloads

This is a package that integrate the web application Letexto API in a laravel application.

Installation

You can install the package via composer:

  $ composer require juvpengele/laravel-letexto

You must add your API Key in the .env file

  .env
	  
  LETEXTO_TOKEN=my-api-token

Features

All resources fetched are an instance of Letexto\Http\Response.

Campaigns

  • To fetch all campaigns

         use Letexto\Resources\Campaign;
         
         $campaigns = Campaign::fetchAll();
  • Filter campaigns to fetch

        use Letexto\Resources\Campaign;
    
       $campaigns = Campaign::filterBy(['status' => 'sent'])->fetchAll();
  • Create a campaign

    To create a campaign, we have to add some attributes that are required by the application using a fluent interface. Here is an example of how a campaign can be sent.

        use Letexto\Resources\Campaign;
    
        $campaign = Campaign::create(['name' => 'My campaign'])
                ->withAttributes([
                    'sender' => 'John Doe', // Add one of your application senders
                    'recipientSource' => 'custom',
                    'campaignType' => 'SIMPLE',
                    'responseUrl' => 'https://mywebsite.com/campaign-feedback', // Add your response url callback    
                ])
                ->to([
                    ['phone' => '22501010101']
                ])
                ->withMessage('Hello world')
                ->send();
  • Messages of a campaign

    To get the messages of a campaign, we must first fetch the campaign as an instance of the Campaign class. In this way, we can fetch messages of this campaign.

     use Letexto\Resources\Campaign;
    
     $campaign = Campaign::find("f9r4gegetg49getg98e49t");
     $messages = $campaign->getMessages();

Messages

  • To fetch all messages

         use Letexto\Resources\Message;
         
         $messages = Message::fetchAll();
  • Filter messages to fetch

       use Letexto\Resources\Message;
    
       $messages = Message::filterBy(['sender' => 'John Doe'])->fetchAll();
  • To fetch statistics of messages

         use Letexto\Resources\Message    
    
         $statistics = Message::getStatistics();

Volume

  • We can retrieve the volume of a user.

          use Letexto\Resources\Volume;
          
          $volume = Volume::retrieve();

Credits

License

The MIT License (MIT). Please see License File for more information.

laravel-letexto's People

Contributors

juvpengele avatar

Stargazers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.