Download the PHP package darinlarimore/statamic-postmaster without Composer

On this page you can find all versions of the php package darinlarimore/statamic-postmaster. 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 statamic-postmaster

Postmaster

Newsletters, natively in Statamic: build emails from blocks in the entry editor, collect subscribers with double opt-in, and deliver through your own mail provider with tracked, queue-backed sendouts.

Postmaster treats a newsletter like content, because in Statamic it is. You author an email as an entry — stacking heading, text, image, and button blocks with Live Preview of the compiled email — pick recipient lists in the sidebar, and hit Publish when it's approved to send. A sendout record tracks the delivery run: opens, clicks, bounces, complaints, and top links.

Supports Statamic 5 and 6 with a single codebase.

Features

How to install

Subscribers and mailing lists live as flat-file content by default (git-friendly; switch to the database driver via POSTMASTER_STORAGE=database for high-volume lists). Sendouts and tracking events always live in the database.

To compile MJML locally, install the node package:

No Node in production? POSTMASTER_MJML=api with MJML API credentials, or POSTMASTER_MJML=none for plain HTML templates. MJML compiles once per sendout, not per recipient.

Optionally publish the config:

Quick start

One command sets up everything: a newsletters collection wired with the Email Blocks fieldset, Live Preview pointed at the email renderer, an example entry showcasing every block and a merge tag, a first mailing list (if you have none), and the email templates published for customizing. It's idempotent and the collections are excluded from sitemaps/SEO automatically. Then:

  1. Open the Example Newsletter entry and hit Live Preview — edit blocks and watch the email re-render.
  2. Send yourself a copy via the entry's Send Test Email action (comma-separated addresses).
  3. Pick lists in the sidebar and toggle Published — the entry's sendout flips to ready to send.
  4. Open it under Postmaster → Sendouts and Send now or Schedule.

The workflow

The entry is the whole authoring surface. In the main column: title, Email Subject (blank falls back to the title), Email Preheader, the Email Blocks, and an advanced Email Template override. In the sidebar: From Name / From Email / Reply To (placeholders show your site's configured defaults; blank uses them), Send to lists, and the Published toggle — the approval gate. Tests and Live Preview work on unpublished drafts, but a sendout can't start until the entry is published.

Sendouts create themselves. Saving a newsletter entry ensures a draft sendout exists for it — one active sendout per entry. Drafts follow the entry live (subject, sender, lists, everything) and freeze when the run starts. The full lifecycle:

The Sendouts screen lists every run with status and progress, offers a New entry button for each newsletter collection, and surfaces any entries that don't have a sendout yet.

Using your own collection

The block set ships as a namespaced fieldset. Import it into any collection blueprint (via the blueprint builder, or in YAML):

Don't use a prefix on the import — the fixed field handles drive the automation. The sidebar fields (sender, lists) and the merge-tag hint are injected at runtime for any blueprint carrying the blocks.

Statamic only shows the Live Preview button for routable collections. The scaffold command handles this by using the addon's (permission-gated) preview URL as the collection route — do the same for a hand-made collection:

Merge tags

Type merge tags anywhere in block text or the subject line:

Core tags: {{ email }}, {{ first_name }}, {{ last_name }}, {{ full_name }}, {{ unsubscribe_url }}, {{ preferences_url }} — plus every custom subscriber field. The entry editor lists exactly what's available. Values are swapped per recipient at send time; unknown tags render as empty text; previews show sample values.

Subscribers, lists & custom fields

Subscribers and lists are ordinary Statamic entries (content driver), so managing them feels native:

The subscriber blueprint is the schema for custom fields. Add a field (say company) to it and everything follows:

On the database driver (no blueprint), list the handles in postmaster.custom_fields instead.

Collecting subscribers

Create a list (Postmaster → Lists), then drop the form tag in any template:

The tag renders the <form> wrapper for you, including the CSRF token, a spam honeypot, and a hidden field carrying the list handles — you only supply the visible inputs. Valid input names are email (required), first_name, last_name, and any custom subscriber field.

Use lists="newsletter|product" to subscribe to multiple lists at once. Add redirect="/thanks" to send visitors to a page instead of flashing a message.

With double opt-in enabled (the default), new subscribers get a confirmation email and stay pending until they click the signed verification link.

AJAX submissions

The subscribe endpoint returns JSON when asked for it, so the same form can submit in the background without a page reload. Here is a complete starter using Alpine that degrades to a normal POST when JavaScript is unavailable:

On success the endpoint returns { success: true, pending: true|false, message: "…" }pending is true when double opt-in is on and the subscriber still needs to confirm. Validation failures return a standard Laravel 422 with an errors object. The plain {{ if success }} / {{ postmaster:errors }} blocks at the bottom handle the no-JavaScript fallback, where the form does a full POST and redirects back.

If your site uses Statamic's static caching, wrap the form in {{ nocache }} so the CSRF token isn't cached stale. The x-cloak attributes need the usual one-liner in your CSS if you don't have it already: [x-cloak] { display: none !important; }.

Email templates

Every sendout renders through one template, published to resources/views/vendor/postmaster/emails/:

The layout renders the entry's blocks — one partial per type — or falls back to classic content ({{ entry:content }} under a subject headline) for entries without blocks:

Three levels of customization:

  1. Restyle a single block — edit its partial (e.g. blocks/button.antlers.html); the rest stays stock.
  2. Add your own block type — override the postmaster::email_blocks fieldset (copy it to resources/fieldsets/vendor/postmaster/email_blocks.yaml), add a set, and drop a matching blocks/{type}.antlers.html. The loop picks it up with zero PHP.
  3. Replace the template entirely — set the entry's Email Template field to any view name (emails.my-newsletterresources/views/emails/my-newsletter.antlers.html, Antlers or Blade, MJML or plain HTML).

Templates receive:

Variable Description
subject, preheader, sendout Sendout fields
entry The newsletter entry (optional)
email, first_name, last_name, full_name Per-subscriber personalization
unsubscribe_url, preferences_url Signed per-subscriber links

The template renders and compiles once per sendout; personalization is substituted per recipient at send time. Links are automatically rewritten for click tracking (disable with postmaster.tracking.clicks).

Queues & scheduling

Sendouts are processed in batches on your queue — run a worker (php artisan queue:work). With the sync driver everything still works; sending just happens in-request. Already-sent recipients are excluded by query, so resuming a paused run (or a retried queue job) can never double-send. Batch size, delay, retries, and the abort threshold are configurable under postmaster.sendout.

Scheduled sendouts fire via the scheduler:

Bounce & complaint webhooks

Set a signing key in .env:

Then point your provider's webhook at:

Hard bounces and spam complaints flip the subscriber to bounced/complained and permanently exclude them from sendouts. (SES SNS subscriptions are auto-confirmed on first delivery.)

Importing

Import from the CP (Postmaster → Subscribers, with a downloadable CSV template) or the command line:

The CSV needs an email column; first_name/last_name and any custom subscriber field columns are picked up when present. Omit --subscribed to import as pending. Export is available from the same screen.

AI assistant (Claude Code)

The addon ships a Claude Code skill teaching an AI assistant this addon's workflow — the entry-drives-everything model, the publish-to-send gate, merge tags, subscriber keying, and the actions that aren't entry writes. It's published to .claude/skills/postmaster/ on install (non-forced, so your edits survive updates), or manually:

With it in place, an assistant can draft a campaign from your content, personalize it with merge tags, and drive the send — using Statamic's native entry tools, since that's all a newsletter is here.

Config reference

See config/postmaster.php — from name/email, mailer, storage driver, queue connection/name, batch settings, double opt-in, verification link expiry, open/click tracking toggles, MJML strategy, redirect URLs, route prefix, and custom subscriber fields.

License

Commercial — one project per license. See LICENSE.


All versions of statamic-postmaster with dependencies

PHP Build Version
Package Version
Requires statamic/cms Version ^5.0|^6.0
php Version ^8.2
spatie/mjml-php Version ^1.2
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 darinlarimore/statamic-postmaster contains the following files

Loading the files please wait ...