Send Laravel email from the job that owns the outcome. Retry safely without sending twice.
Dispatch product email from Laravel's queue, use a stable idempotency key for retries, and trace each accepted message through delivery.
✓Use it beside Mailables or Notifications when product email needs lifecycle context and a delivery trail.
One request, complete trace
Request
POST /api/v1/emails
Authorization: Bearer aem_…
Idempotency-Key: welcome-8f21
{ "to": "[email protected]", "template": "welcome" }
202 Accepted
{ "id": "msg_7ca31", "status": "queued" }
[ 01 / 03 ]Integration shape
Let Laravel own the job and Send & Retain own delivery.
Use jobs, notifications, and controllers
Dispatch after the application change commits; let your queue retry local work with the same message key.
Publish product events
Turn domain events and listeners into lifecycle triggers instead of scattering follow-up sends across controllers.
Verify the webhook
A route excluded from CSRF middleware, reading $request->getContent() raw.
[ 02 / 03 ]Server quickstart
Queue one Laravel email with an idempotency key.
A retried job can reuse the same logical key, while the accepted message ID gives the application a delivery reference.
Use the framework HTTP client and treat the accepted ID as the start of the trace.
$response = Http::withToken(env('AEM_KEY'))
->withHeaders(['Idempotency-Key' => "welcome-{$user->id}"])
->post('https://sendandretain.com/api/v1/emails', [
'to' => $user->email, 'template' => 'welcome',
])->throw()->json();Accepted response
{ "id": "msg_7ca31", "status": "queued" }[ 03 / 03 ]Related
Keep building with Laravel
Questions people ask us
Make your next Laravel job visible through delivery.
Dispatch one product message with a stable key and follow its accepted ID to the result.