mailgatewayid / laravel
Laravel mail transport for MailGateway.id (MAIL_MAILER=mailgateway)
v0.2.1
2026-11-13 06:55 UTC
Requires
- php: >=8.2
- illuminate/mail: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- mailgatewayid/php: ^0.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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.