List, create, update, and delete webhooks from Laravel
Webhooks deliver real-time notifications when emails are delivered, opened, clicked, bounced, or marked as spam. Manage your webhook endpoints through the Lettr facade.For the event payload format and signature verification, see Webhooks.
Use WebhookEventsMode::All to receive every event type (no events array needed), or WebhookEventsMode::Selected with an explicit events array. For authenticated endpoints, set authType to WebhookAuthType::Basic or WebhookAuthType::OAuth2 and supply the matching credentials (authUsername/authPassword or the oauth* fields).
use Lettr\Enums\WebhookEventType;$webhook = Lettr::webhooks()->get('webhook-id');echo $webhook->name;echo $webhook->url;echo $webhook->lastStatus?->value;echo $webhook->lastSuccessfulAt;echo $webhook->lastFailureAt;// Check if the webhook listens to a specific eventif ($webhook->listensTo(WebhookEventType::MessageBounce)) { echo "Webhook receives bounce notifications";}