Skip to content

RevisionTen/rapidmail

Repository files navigation

revision-ten/rapidmail

Installation

Install via composer

Run composer req revision-ten/rapidmail.

Add the Bundle

Add the bundle to your AppKernel (Symfony 3.4.*) or your Bundles.php (Symfony 4.*).

Symfony 3.4.* /app/AppKernel.php:

new \RevisionTen\Rapidmail\RapidmailBundle(),

Symfony 4.* /config/bundles.php:

RevisionTen\Rapidmail\RapidmailBundle::class => ['all' => true],

Configuration

Configure the bundle:

rapidmail:
    api_username_hash: 'XXXXXXX'
    api_password_hash: 'XXXXXXX'
    campaigns:
        dailyNewsletterCampagin:
            list_id: '123456' # Id of your newsletter list.

Usage

Use the RapidmailService to subscribe users.

Symfony 3.4.* example:

$rapidmailService = $this->container->get(RapidmailService::class);

$subscribed = $rapidmailService->subscribe('dailyNewsletterCampagin', '[email protected]', 'My Website', [
    'FNAME' => 'John',
    'LNAME' => 'Doe',
]);

Or unsubscribe users:

$rapidmailService = $this->container->get(RapidmailService::class);

$unsubscribed = $rapidmailService->unsubscribe('dailyNewsletterCampagin', '[email protected]');

About

A wrapper for the rapidmail library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages