2017 © Pedro Peláez
 

library laravel-newsletter-subscription

Simple newsletter subscription for Laravel projects.

image

riverskies/laravel-newsletter-subscription

Simple newsletter subscription for Laravel projects.

  • Friday, September 8, 2017
  • by barnabaskecskes
  • Repository
  • 1 Watchers
  • 5 Stars
  • 143 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 29 % Grown

The README.md

Laravel Newsletter Subscription

A simple package to enable newsletter subscriptions within the context of a Laravel application., (*1)

Installation

$ composer require riverskies/laravel-newsletter-subscription

Laravel 5.4 or earlier

Add the service provider to your config/app.php file:, (*2)

'providers' => [
    // ...
    Riverskies\LaravelNewsletterSubscription\Providers\NewsletterSubscriptionServiceProvider::class,
];

Usage

Include a simple form anywhere within your pages., (*3)

<form action="/subscribe" method="POST">
    {{ csrf_field() }}
    <input type="email" name="email"/>
    <button type="submit">Subscribe</button>
</form>

You might also want to include notification display on the same page., (*4)

@if(session('flash'))
    <p>{{ session('flash') }}</p>
@endif

Subscriptions

This package collects email addresses and stores them in the database. You can access these subscriptions by querying the Riverskies\LaravelNewsletterSubscription\NewsletterSubscription Eloquent model., (*5)

Note

This package uses the Mail facade to deliver the emails and delivery is queued, so ensure your QUEUE_DRIVER in your environment config is set accordingly., (*6)

Publishing assets

You can override the database table name, the associated URLs, email template format and the session key by overriding the default configuration values., (*7)

$ php artisan vendor:publish --tag='newsletter-subscription-config'

You can design the confirmation email by overriding the default view., (*8)

$ php artisan vendor:publish --tag='newsletter-subscription-views'

You can localise/change the messages by overriding the default localisation values., (*9)

$ php artisan vendor:publish --tag='newsletter-subscription-translations'

Considerations

This package uses hashids/hashids to help derive unsubscribe links from the id fields of the subscription records. Those hashes are not stored in the database but instead encoded/decoded at runtime. To generate unique codes, this package uses the APP_KEY from the environment settings. If that changes, previously generated unsubscribe links will no longer work., (*10)

Contributions

PRs are welcome as long as they are following PSR-2 standards and include all the corresponding tests that the change requires (not to mention that those should not break any previous behaviour either)., (*11)

The Versions

08/09 2017

dev-master

9999999-dev

Simple newsletter subscription for Laravel projects.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Barnabas Kecskes

08/09 2017

1.2.1

1.2.1.0

Simple newsletter subscription for Laravel projects.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Barnabas Kecskes

08/09 2017

v1.2

1.2.0.0

Simple newsletter subscription for Laravel projects.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Barnabas Kecskes

08/09 2017

v1.1

1.1.0.0

Simple newsletter subscription for Laravel projects.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Barnabas Kecskes

06/09 2017

v1.0

1.0.0.0

Simple newsletter subscription for Laravel projects.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Barnabas Kecskes