Download the PHP package kadirgulec/newsletter without Composer

On this page you can find all versions of the php package kadirgulec/newsletter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package newsletter

Laravel Newsletter Package

A lightweight, database-driven newsletter system for Laravel. It handles subscriptions, unsubscriptions via secure signed URLs, and sends RFC-compliant emails to ensure high deliverability (Gmail/Outlook friendly).

Features


Installation

Installing via Composer

Post-Installation

After installing, run the migrations to create the subscribers table:


Usage

1. The Subscription Form

You can place this HTML form anywhere in your application (footer, sidebar, popup, etc.).

2. Sending a Newsletter

You can send a newsletter from any Controller, Artisan Command, or Job.

Tip: For large lists, it is highly recommended to queue these emails using Laravel Jobs to prevent your page from timing out.

3. Unsubscribing

This process is automated and prefetch-safe.

  1. Every email sent via NewsletterMail includes a Footer Link and the List-Unsubscribe + List-Unsubscribe-Post: List-Unsubscribe=One-Click headers (RFC 8058).
  2. The signed URL (/newsletter/unsubscribe/{id}?signature=...) responds to both:
    • GET — renders a confirmation page with a button. Mailbox link-scanners and antivirus prefetchers that hit the URL do not unsubscribe the user.
    • POST — performs the unsubscribe. Used by the confirmation form and by mailbox providers (Gmail, Outlook, …) when the user clicks their built-in "Unsubscribe" UI.
  3. On successful unsubscribe, unsubscribed_at is set and the user sees the unsubscribe-success view.

If the same email later resubscribes through the form, unsubscribed_at is cleared and subscribed_at is refreshed.


Database Structure

The package creates a table named newsletter_subscribers.

Column Type Description
id BigInt Primary Key
email String Unique email address
subscribed_at Timestamp Nullable. Set when the user subscribes; cleared/unused implies they were never confirmed
unsubscribed_at Timestamp Nullable. Set when the user unsubscribes; null means still active
unsubscribe_reason Text Nullable. Optional free-text reason captured at unsubscribe time
created_at Timestamp Row insert date
updated_at Timestamp Row update date
deleted_at Timestamp Nullable. Reserved for soft deletes

A subscriber is considered active when subscribed_at IS NOT NULL and unsubscribed_at IS NULL. Use the Subscriber::active() scope rather than checking the columns directly.

The package also creates a table named newsletter_campaigns.

Column Type Description
id BigInt Primary Key
subject String The email subject
content LongText The HTML content of the email
status String draft or sent
sent_at Timestamp Nullable. Date when the campaign was sent

Customization

Publishing Views

You can publish the email layout and the "Unsubscribe Success" page to your main resources/views folder to customize them.

This will generate:

  1. resources/views/vendor/newsletter/email/standard.blade.php (The Email Layout)
  2. resources/views/vendor/newsletter/confirm-unsubscribe.blade.php (The "Confirm unsubscribe" page)
  3. resources/views/vendor/newsletter/unsubscribe-success.blade.php (The "You have unsubscribed" page)

Extending the Model

If you need to add relationships (e.g., linking a subscriber to a User), you can extend the model or use the provided one:


Troubleshooting

Error: Route [newsletter.subscribe] not defined.

Error: 403 Invalid Signature on Unsubscribe.


Testing

The package includes a comprehensive test suite using PHPUnit and Orchestra Testbench.

Running Tests

  1. Install development dependencies:

  2. Run the tests:

The tests cover:


License

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


All versions of newsletter with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kadirgulec/newsletter contains the following files

Loading the files please wait ...