feat(mail): add Resend delivery, inbox replies and notification tiers
This commit is contained in:
1 parent
208536e1cb
commit
ad42a0e1e7
53 files changed
+2626
-43
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\V1\Guest;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\MailFlow\DeliveryEvents;
|
||||
use App\Services\MailFlow\Settings;
|
||||
use App\Services\MailFlow\WebhookSignature;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ResendController extends Controller
|
||||
{
|
||||
public function webhook(Request $request, WebhookSignature $signature, DeliveryEvents $events)
|
||||
{
|
||||
abort_unless(Settings::get('enabled'), 404);
|
||||
$body = $request->getContent();
|
||||
abort_if(strlen($body) > 262144, 413);
|
||||
$id = (string) $request->header('svix-id');
|
||||
abort_unless($signature->valid($body, $id, (string) $request->header('svix-timestamp'),
|
||||
(string) $request->header('svix-signature'), (string) Settings::get('resend_webhook_secret')), 401);
|
||||
$event = json_decode($body, true);
|
||||
abort_unless(is_array($event), 400);
|
||||
$events->receive($id, $event);
|
||||
return response()->json(['ok' => true]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user