Search by

mailgatewayid / laravel

infranestid

Laravel mail transport for MailGateway.id (MAIL_MAILER=mailgateway)

v0.2.1 2026-11-13 06:55 UTC

This package is auto-updated.

Last update: 2026-11-13 06:55:46 UTC


README

composer require mailgatewayid/laravel

.env:

MAIL_MAILER=mailgateway
MAILGATEWAY_API_KEY=mg_live_xxxxxxxx
MAIL_FROM_ADDRESS=no-reply@domainanda.id

Kode lama tetap jalan: Mail::to($user)->send(new OrderShipped($order));

Retry aman (Idempotency-Key, opsional, berlaku 24 jam). Tambahkan header di Mailable; untuk banyak penerima, key otomatis diberi akhiran alamat penerima:

public function headers(): \Illuminate\Mail\Mailables\Headers
{
    return new \Illuminate\Mail\Mailables\Headers(text: ['Idempotency-Key' => 'invoice-' . $this->order->id]);
}

Verifikasi email & webhook:

use MailGateway\MailGateway;

app(MailGateway::class)->verify('user@gmail.com');
MailGateway::verifyWebhookSignature($request->getContent(), $request->header('X-MailGateway-Signature'), env('MAILGATEWAY_WEBHOOK_SECRET'));

Catatan: lampiran belum didukung Email API; gunakan SMTP Relay untuk email berlampiran.