Download the PHP package dcodegroup/laravel-logged-inbound-email without Composer

On this page you can find all versions of the php package dcodegroup/laravel-logged-inbound-email. 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 laravel-logged-inbound-email

Laravel Inbound Email

Multi-provider inbound email webhooks for Laravel. Incoming HTTP requests are verified per provider, normalized into an InboundMessage DTO, and handled asynchronously via one queued job class you configure.

Supported providers: Mailgun, Postmark, SendGrid, Amazon SES (via SNS), Mailpit, Resend.

Requirements: PHP ^8.4, Laravel 12.x+ (Illuminate ^12^13 per composer.json).


Install

The package registers its service provider automatically (extra.laravel.providers in Composer).

Publish configuration (recommended)

This copies config/inbound-email.php into your app. Until you publish, the package merges the same defaults from the vendor file.


Routes

Routes are registered under a configurable prefix (default webhooks/inbound). Middleware defaults to api (no session/CSRF). If you switch to web, add these paths to VerifyCsrfToken $except or use stateless verification.

Single-tenant (default)

organization_in_route is false. Pattern:

Examples (default prefix):

Provider Example path
Mailgun POST /webhooks/inbound/mailgun
Postmark POST /webhooks/inbound/postmark
SendGrid POST /webhooks/inbound/sendgrid
SES (SNS) POST /webhooks/inbound/ses
Mailpit POST /webhooks/inbound/mailpit
Resend POST /webhooks/inbound/resend

Multi-tenant / SaaS

Set INBOUND_EMAIL_ORG_IN_ROUTE=true or config(['inbound-email.organization_in_route' => true]). Pattern:

Example: POST https://your-app.test/webhooks/inbound/acme-corp/mailgun

Switching modes: With multi-tenant routes enabled, old single-segment URLs such as POST /webhooks/inbound/mailgun are not registered. Point each provider’s webhook at the per-organization URL instead.

Prefix: INBOUND_EMAIL_ROUTE_PREFIX or config('inbound-email.route_prefix') (no leading/trailing slashes required in env; the package trims as needed).

Tenant column and relationship (opt-in)

By default the inbound_emails table has no tenant_id column at all. Set INBOUND_EMAIL_MULTI_TENANT_ENABLED=true (and INBOUND_EMAIL_TENANT_MODEL to your tenant model's FQCN) before running php artisan migrate in your app, and the migration adds a nullable, indexed tenant_id column, and InboundEmail::tenant() becomes available as a belongsTo relation to that model.

The package never populates tenant_id itself — your app sets it on the row after it exists.

This is a one-time, initial-setup flag. Flipping it after the table has already been migrated does not retroactively add or drop the column; write your own follow-up migration if you enable multi-tenancy later. Calling tenant() while the flag is off returns null rather than a relation instance.

Email-based tenant discovery

An alternative to organization_in_route for setups where the webhook route isn't controllable (e.g. a fixed provider URL): identify the tenant from the recipient address itself. The package's default technique is plus-addressing, {tenant_identifier}+{process}@domain.

Set INBOUND_EMAIL_EMAIL_BASED_TENANCY_ENABLED=true or config(['inbound-email.email_based_tenancy_enabled' => true]). Unlike organization_in_route, this is not mutually exclusive — both strategies can be enabled at the same time. When both produce a tenant identifier and they disagree, the route-derived value wins (plus-addressing is a fallback, not an override).

The resolved identifier is stored on InboundEmail::organization_alias, same as route-based discovery.

To use your own scheme instead of plus-addressing, set INBOUND_EMAIL_TENANT_RESOLVER (or config(['inbound-email.tenant_resolver' => ...])) to the FQCN of a class implementing Dcodegroup\LaravelLoggedInboundEmail\Contracts\EmailBasedTenantResolver:

The class is resolved via the container, so it may declare its own constructor dependencies.


Configuration overview

Env / concern Purpose
INBOUND_EMAIL_ROUTE_PREFIX URL prefix for all inbound routes (default webhooks/inbound).
INBOUND_EMAIL_ORG_IN_ROUTE true = {orgAlias}/{provider} URLs; false = {provider} only.
INBOUND_EMAIL_ORG_ALIAS_PATTERN Regex (no delimiters) for {orgAlias} when org routing is on.
INBOUND_EMAIL_MULTI_TENANT_ENABLED true adds the tenant_id column/index at migration time and enables InboundEmail::tenant(). Default false.
INBOUND_EMAIL_TENANT_MODEL FQCN of your tenant model, used by InboundEmail::tenant().
INBOUND_EMAIL_EMAIL_BASED_TENANCY_ENABLED true = also parse the tenant identifier from a plus-addressed recipient ({tenant_identifier}+{process}@domain). Can be combined with INBOUND_EMAIL_ORG_IN_ROUTE; the route value wins on disagreement.
INBOUND_EMAIL_TENANT_RESOLVER FQCN of a class implementing EmailBasedTenantResolver, used when email-based tenancy is enabled. Default: package EmailAddressTenantResolver.
INBOUND_EMAIL_JOB FQCN of your queued job (implements ProcessesInboundEmail). Default: package ProcessInboundEmailJob (debug log only).
INBOUND_EMAIL_QUEUE_CONNECTION Optional queue connection for the dispatch.
INBOUND_EMAIL_QUEUE Optional queue name for the dispatch.

Provider secrets and options (set only what you use):

Env Provider
INBOUND_EMAIL_MAILGUN_SIGNING_KEY Mailgun
INBOUND_EMAIL_POSTMARK_WEBHOOK_SECRET Postmark
INBOUND_EMAIL_SENDGRID_VERIFICATION_KEY SendGrid
INBOUND_EMAIL_SES_ALLOW_UNSIGNED_SNS, INBOUND_EMAIL_SES_S3_DISK SES
INBOUND_EMAIL_MAILPIT_BASE_URL, INBOUND_EMAIL_MAILPIT_API_TOKEN, INBOUND_EMAIL_MAILPIT_WEBHOOK_SECRET Mailpit
INBOUND_EMAIL_RESEND_WEBHOOK_SECRET, INBOUND_EMAIL_RESEND_API_KEY, INBOUND_EMAIL_RESEND_API_BASE_URL Resend

Full keys and comments live in the published config/inbound-email.php.


Processing messages

The webhook controller verifies the request, builds an InboundMessage, and dispatches your job class from config('inbound-email.job'). There is no extra wrapper job.

Job requirements

  1. Implement Dcodegroup\LaravelLoggedInboundEmail\Contracts\ProcessesInboundEmail (extends ShouldQueue).
  2. Use Illuminate\Foundation\Bus\Dispatchable (and typically Queueable, InteractsWithQueue, SerializesModels).
  3. array $message — Serialized InboundMessage (InboundMessage::toArray() shape).
  4. Multi-tenant only: second constructor parameter string $orgAlias — value of {orgAlias} from the URL. When organization_in_route is false, the package dispatches with only $message, so a one-argument constructor remains valid for single-tenant setups.

Rebuild the DTO in handle():

Dispatch behavior

organization_in_route Call
false YourJob::dispatch($messageArray)
true YourJob::dispatch($messageArray, $orgAlias)

Queue connection and queue name from config are applied to the pending dispatch when set.

Example job

Registering your job class

Environment or published config:

Runtime (e.g. AppServiceProvider):


Development


All versions of laravel-logged-inbound-email with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
guzzlehttp/guzzle Version ^7.8
illuminate/bus Version ^11.0|^12.0|^13.0
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/filesystem Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/queue Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.16
svix/svix Version ^1.0
symfony/mime Version ^6.4|^7.0|^8.0
zbateson/mail-mime-parser Version ^4.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 dcodegroup/laravel-logged-inbound-email contains the following files

Loading the files please wait ...