sputnik/newsletter-bundle

Provides subscriber functionality for various newsletters/subscription lists.

Installs: 215

Dependents: 0

Stars: 2

Watchers: 3

Forks: 1

Language: PHP

v0.1.0 2013-08-21 13:17 UTC

README

SputnikNewsletterBundle provides subscription functionality for various newsletter/subscription lists. This bundle was inspired by wonderful Stampie library as well as used as a foundation for current one.

Main features
  • Configuration of multiple subscribers.
  • Foundation for multiple subscriber types (at the moment only CampaignMonitor is supported).
  • Console command for manual email subscription.

Note: There is a sample Sandbox application with Sputnik bundles installed and configured - https://github.com/sputnik-project/sandbox.

Build Status

Quick example

Service usage
use Sputnik\Bundle\NewsletterBundle\Message\Subscription;

class MyController extends Controller
{
    public function subscribeAction($email)
    {
        try {
            $this->get('sputnik_newsletter.campaign_monitor')->subscribe(new Subscription($email));
        } catch (\RuntimeException $e) {
            $e->getMessage(); // API message
            $e->getPrevious()->getMessage(); // HTTP error
            $e->getPrevious()->getStatusCode(); // HTTP error code

            // Return erroneous response here.
        }

        // Return successful response here.
    }
}

Documentation

Documentation can be found in Resources/doc. You can start with installation instructions.

API documentation.

Resources