Laravel integration

Transactional email for Laravel — no Mailable bloat

POST a domain event from your Laravel app using the built-in HTTP client. else.events routes it, renders the template and delivers through your provider.

Laravel Mailables grow unwieldy as your SaaS scales

One Mailable class per email variation

Pro plan payment failed in German? That is a separate Mailable or a deeply branching envelope() method.

Blade email templates are coupled to your repo

Every copy change to a Blade email template means a commit, a PR and a deploy — even for a typo.

No central view of all emails sent

Mailables dispatched from jobs, controllers and listeners are hard to track. There is no single log of what was sent when and why.

Provider migrations touch every Mailable

Switching from Mailgun to Postmark means reconfiguring your mailer and potentially touching every Mailable that uses transport-specific features.

Replace Mailable dispatches with one event call

Laravel HTTP client — no Guzzle setup

Use Laravel's built-in Http facade. One POST replaces every Mail::to()->send() call.

Templates outside your repository

Edit subject lines and copy in the else.events dashboard. No Blade changes, no deployment.

Rule-based routing by plan, locale or tenant

else.events reads your payload and picks the right template. Your Laravel app does not need to know which template to use.

Delivery logs with domain context

See every event, matched rule and email status — queryable by event type, user or date.

// Laravel — Http facade

Send an event with the Laravel HTTP client.

// app/Services/EmailService.php
class EmailService
{
    public function sendEvent(string $type, array $user, array $data): void
    {
        Http::withToken(config('services.else_events.api_key'))
            ->post('https://app.else.events/api/events', [
                'type' => $type,
                'user' => $user,
                'data' => $data,
            ]);
    }
}

// Usage in a job or listener
$emailService->sendEvent(
    'invoice.payment_failed',
    ['email' => $invoice->user->email, 'name' => $invoice->user->name],
    ['plan' => $invoice->plan, 'amount' => $invoice->amount,
     'currency' => 'EUR', 'update_payment_url' => route('billing.update')]
);

Add ELSE_EVENTS_API_KEY to your .env and config/services.php. One service class replaces every Mailable dispatch for product emails.

Frequently asked questions

Should I use the Http facade or Guzzle directly?
Laravel's Http facade wraps Guzzle and is the cleanest option. It handles retries with Http::retry() and throws on errors by default with ->throw().
Can I queue the HTTP call?
Yes. Dispatch a job that calls EmailService::sendEvent(). This keeps your controllers responsive and lets you retry failed events.
How do I set the API key?
Add ELSE_EVENTS_API_KEY to your .env file and reference it in config/services.php. Use config('services.else_events.api_key') in your service class.
Can I use this with Laravel event listeners?
Yes. Register a listener for your domain events (e.g. PaymentFailed) and call EmailService::sendEvent() from the listener. Keep email logic separate from domain logic.

Laravel email workflows — without Mailable sprawl.

One HTTP call per event. Templates managed outside your repository. No Blade template deployments.

  • Uses built-in Laravel Http facade
  • Templates editable without deployments
  • Works with queued jobs and listeners