Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Email Tracking Laravel Package

henryavila/email-tracking

Laravel package for email tracking that monitors opens and link clicks by injecting tracking pixels, rewriting URLs, and recording engagement events, with per-message analytics to help measure campaign performance.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. henryavila/email-tracking is a Laravel-native package that hooks into Illuminate\Mail\Events\MessageSent to persist outbound email metadata (recipients, subject, message IDs, and now email type classification). Architecturally it is a thin, event-driven sidecar to Laravel's mail subsystem — it does not wrap or replace the mailer, which keeps it low-coupling. The v7.0.0 addition of typed classification (supporting both BackedEnum and string values) is the most product-relevant change: it converts the package from a raw audit log into a filterable analytics substrate (transactional vs. marketing vs. notification), which materially improves downstream reporting and deliverability segmentation.

Integration feasibility. Straightforward if and only if the host application is already on Laravel 11+. Installation remains a single composer require plus event registration. The one non-trivial integration detail is the event registration pattern change: Laravel 11 removed the default EventServiceProvider::$listen convention, so teams must move the listener registration into AppServiceProvider::boot() via Event::listen(...). This is a silent-failure risk — a missed registration means tracking simply stops, with no error. Any team on Laravel 9/10 faces a much larger prerequisite: a full framework upgrade before this package can move at all.

Technical risk.

  • High: Forced platform jump. This is not an incremental upgrade — it is gated behind PHP 8.2+ and Laravel 11+, meaning the package upgrade is coupled to a framework major-version migration. That coupling is the dominant risk and should be planned as a framework project, not a dependency bump.
  • Medium: Silent degradation from the event-registration change (above). Needs an explicit post-deploy verification that rows are still being written.
  • Medium: Major-version schema/migration changes — the release notes mention migration naming convention changes ("numeric prefixes") and fixed "test database migration ordering," which hints at migration file renames. Renamed published migrations can cause duplicate-run or ordering issues in existing environments.
  • Low–Medium: New classification feature requires a nullable/typed column and enum handling; existing rows will need a default or backfill strategy.
  • Low: Package maturity signals are genuinely strong — 139 tests, ~92.8% coverage, PHPStan Level 4, CI matrix across PHP 8.2–8.4 × Laravel 11/12 on Ubuntu and Windows. That is above average for a community package.

Key questions.

  1. Is the host application already on Laravel 11+ and PHP 8.2+? If not, this upgrade is blocked behind a separate, larger initiative.
  2. Is henryavila/email-tracking on the critical path (compliance/audit, deliverability, customer-facing email history) or purely observational? Critical-path status changes the risk posture significantly.
  3. Does the new email-type classification require a schema migration, and is there a backfill/default defined for the existing email history?
  4. Are published migrations being renamed by this release, and if so, what is the safe upgrade sequence for environments that already ran the old ones?
  5. What is the package's maintenance trajectory and bus-factor? Single-maintainer (henryavila) projects carry succession risk regardless of test coverage.
  6. Does the application emit mail outside the standard MessageSent path (queued batches, third-party transports, notifications bypassing the mailer) that would remain untracked?

Integration Approach

Stack fit. Requires PHP 8.2/8.3/8.4 and Laravel 11 or 12. Explicitly drops PHP 8.1, Laravel 9.x, and Laravel 10.x. This aligns the package with Laravel 11 LTS and Laravel 12 — the correct long-term target — but it is a hard gate, not a soft preference. The package is a natural fit for any Laravel monolith or modular monolith that already sends mail through Laravel's mailer and wants audit/analytics without adopting an external ESP's tracking stack.

Migration path. Treat this as a two-track rollout:

  1. Track A (blocking prerequisite): Upgrade PHP to 8.2+ and the framework to Laravel 11 (following Laravel's own upgrade guide). Do not attempt to co-schedule this with the package bump.
  2. Track B (package): Once on Laravel 11, composer require henryavila/email-tracking:^7.0, then rewrite the listener registration from EventServiceProvider::$listen into AppServiceProvider::boot() using Event::listen(...).
  3. Verification gate: Confirm outbound mail still produces tracking records via a smoke test in staging before promoting to production — this is the step that catches the silent-registration failure.
  4. Optional follow-on: Adopt email-type classification as a separate, low-risk change once tracking parity is confirmed.

Compatibility. The package is well-validated across the supported matrix (PHP 8.2–8.4 × Laravel 11/12, Ubuntu and Windows), which reduces "works on my machine" risk. The residual compatibility surface is the application's own customizations: any local overrides of the package's models, migrations, or listener, and any custom mail transport that bypasses MessageSent.

Sequencing. Strictly ordered: (1) PHP upgrade → (2) Laravel 11 upgrade and stabilization → (3) package v7 upgrade with event-registration rewrite → (4) staging verification of tracking writes → (5) production rollout with a monitoring window → (6) email-type classification as a discrete follow-up. Attempting to collapse (1)–(3) into one change set is the primary way this goes wrong.

Operational Impact

Maintenance. Low ongoing surface area: event-driven, no long-running processes, no external service dependency, no daemon to babysit. The maintenance cost is concentrated almost entirely in the upgrade event itself. The package's own engineering hygiene (Pest 3, PHPUnit 11, PHPStan L4, Pint, Codecov) suggests the maintainer intends to keep pace with Laravel releases — a positive signal for staying current. Counterweight: it is a single-maintainer community package, so budget for the possibility of taking a fork or vendored patch if the maintainer steps away or lags on Laravel 13.

Support. Documentation was meaningfully improved in this release — a step-by-step upgrade guide, Laravel 11-pattern examples, and clearer README. That reduces internal support load. However, support during the migration window will be elevated: the failure mode (missing event registration) is silent and will generate "why did tracking stop?" investigations unless engineering pre-empts it with a documented verification step and an alert on tracking-record volume.

Scaling. Tracking writes are one insert per sent email, synchronous with the mail event unless the listener is queued. At high mail volumes this adds write pressure to the primary database and can add latency to the send path. Recommended mitigations: queue the listener if not already queued, and plan retention/archival on the tracking table (it grows monotonically and is rarely needed hot beyond 90–180 days). Email-type classification improves query ergonomics but also adds an indexed-column consideration if used as a primary filter in dashboards.

Failure modes.

  • Silent tracking loss from the removed EventServiceProvider::$listen registration — the highest-probability failure and the hardest to notice. Mitigate with a synthetic send in staging plus a production alert on tracking-row volume dropping to zero.
  • Migration conflicts from renamed/numeric-prefixed migrations in environments that already ran the prior versions.
  • Blocked upgrade discovered late — if the Laravel 11 prerequisite was assumed rather than verified, the whole initiative stalls at step 2.
  • Null email types on historical rows if the classification column is added without a default, breaking any filter or grouping built on it.
  • Untracked mail paths if the application sends via non-standard transports or bypasses the mailer.

Ramp-up. For a team already on Laravel 11: roughly a half-day to one day — composer bump, one event-registration edit, a migration check, and a staging verification. For a team on Laravel 10 or below: dominated entirely by the framework upgrade, realistically one to several weeks depending on application size and third-party dependency readiness. The package itself is not the work; the platform uplift is. Recommended ownership: an engineer familiar with the mail subsystem for the integration, with TPM-level tracking of the Laravel 11 prerequisite as a separate, explicitly-funded milestone so the package upgrade is never mistaken for a routine patch release.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle