Looking to hire Laravel developers? Try LaraJobs

email-parser-laravel maintained by wildye

Description
Laravel integration for GhostParse: a verified webhook route that turns inbound email into Laravel events.
Author
WILDYE LIMITED
Last update
2026/10/10 09:34 (dev-main)
License
Links
Downloads
2

Comments
comments powered by Disqus

GhostParse for Laravel

A verified webhook route that turns inbound email into Laravel events, plus the API client as a facade. Laravel 10, 11 and 12.

composer require wildye/email-parser-laravel

.env:

EMAIL_PARSER_WEBHOOK_SECRET=whsec_…   # Inbound webhook page
EMAIL_PARSER_API_KEY=ek_live_…        # optional: only to call the API

Set your webhook URL (dashboard, Inbound webhook) to https://your-app.example/email-parser/webhook. Change the path with EMAIL_PARSER_WEBHOOK_PATH. The route needs no CSRF token or session: the signature authenticates it.

Listen for email

use Illuminate\Support\Facades\Event;
use Wildye\EmailParser\Laravel\Events\InboundEmailReceived;

Event::listen(function (InboundEmailReceived $event) {
    $email = $event->email; // Wildye\EmailParser\InboundEmail
    Ticket::firstOrCreate(['thread_id' => $email->threadId])
        ->replies()->firstOrCreate(['message_id' => $email->messageId], [
            'from' => $email->from?->address,
            'body' => $email->replyText,
            'order_number' => $email->field('order_number'),
        ]);
});

Listeners run before the response is sent, so if one throws, the delivery fails and the sending server retries: nothing is lost. Make them idempotent (the firstOrCreate on message_id above), or queue them (implements ShouldQueue). Signature failures get a 400 and dispatch nothing. WebhookTestReceived is dispatched for the dashboard's "Send test event".

Call the API

use Wildye\EmailParser\Laravel\Facades\EmailParser;

EmailParser::sendSample();
EmailParser::forAccount($subAccountId)->domains()->create('bobsbakery.com', inboundEnabled: true); // resellers

Publish the config with php artisan vendor:publish --tag=email-parser-config.