2017 © Pedro Peláez
 

symfony-bundle sparkpost-bundle

This bundle provides integration with the Sparkpost API library, allowing you to interact with the Sparkpost API from within your Symfony projects

image

hanfrey/sparkpost-bundle

This bundle provides integration with the Sparkpost API library, allowing you to interact with the Sparkpost API from within your Symfony projects

  • Thursday, May 18, 2017
  • by Hanfrey
  • Repository
  • 1 Watchers
  • 10 Stars
  • 6,148 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 2 Versions
  • 8 % Grown

The README.md

sparkpost-bundle Software License

Bundle for using Sparkpost in symfony, (*1)

Installation

Step 1) Get the bundle

composer require hanfrey/sparkpost-bundle

Step 2) Register the bundle

To start using the bundle, register it in your Kernel., (*2)

``` php <?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Hanfrey\SparkpostBundle\HanfreySparkpostBundle(), // ... ); }, (*3)


## Step 3) Configure the default API token to use (mandatory) Here is an example: ```yaml # app/config/config.yml hanfrey_sparkpost: api_token: 1212334ba # replace with your own

Step 4) Example Usage in a controller

$sparky= $this->get("hanfrey_sparkpost.api_client");

try {
    // Build your email and send it!
    $results = $sparky->transmission->send([
        'from'=>'From Envelope <from@sparkpostbox.com>',
        'html'=>'<html><body>

Congratulations, {{name}}!

You just sent your very first mailing!, (*4)

</body></html>', 'text'=>'Congratulations, {{name}}!! You just sent your very first mailing!', 'substitutionData'=>['name'=>'YOUR FIRST NAME'], 'subject'=>'First Mailing From PHP', 'recipients'=>[ [ 'address'=>[ 'name'=>'YOUR FULL NAME', 'email'=>'YOUR EMAIL ADDRESS' ] ] ] ]); echo 'Woohoo! You just sent your first mailing!'; } catch (\Exception $err) { echo 'Whoops! Something went wrong'; var_dump($err); }

Documentation

Detailed documentation on how to access each API method can be found in the documentation of the package that this bundle integrates: Sparkpost API library, (*5)

The Versions

18/05 2017

dev-master

9999999-dev

This bundle provides integration with the Sparkpost API library, allowing you to interact with the Sparkpost API from within your Symfony projects

  Sources   Download

MIT

The Requires

 

The Development Requires

api bundle symfony sparkpost

27/02 2016

1.0.0.x-dev

1.0.0.9999999-dev

This bundle provides integration with the Sparkpost API library, allowing you to interact with the Sparkpost API from within your Symfony projects

  Sources   Download

MIT

The Requires

 

The Development Requires

api bundle symfony sparkpost