Install
Configure
Add your API key to your.env file:
.env
Send email
Using the Laravel Mail driver
SendKit integrates with Laravel’s built-in Mail system. Just set the mailer in your.env:
.env
Mail facade as usual:
Using the SendKit facade
If you need more control, you can use the SendKit facade directly:Validate email
Validate an email address before sending. Each validation costs credits.evaluations array contains:
| Key | Description |
|---|---|
has_valid_syntax | Whether the email has valid syntax |
has_valid_dns | Whether the domain has valid DNS records |
mailbox_exists | Whether the mailbox exists |
is_role_address | Whether it’s a role address (e.g. info@, admin@) |
is_disposable | Whether it’s a disposable email |
is_random_input | Whether it appears to be random input |
Webhooks
The package automatically registers aPOST /webhook/sendkit route in your application — no extra setup needed. When SendKit sends a webhook to this endpoint, the package verifies the signature and dispatches a Laravel event you can listen to.
Add your webhook secret
To verify that incoming webhooks are actually from SendKit, add your webhook secret to.env:
.env
403 response.
If no secret is configured, signature verification is skipped. We strongly recommend always setting a secret in production.
Customizing the webhook path
By default the webhook listens at/webhook/sendkit. You can change this with an environment variable:
.env
POST /api/webhooks/sendkit instead. Make sure to update the webhook URL in your SendKit dashboard to match.
Listening for events
When a webhook is received, the package dispatches a Laravel event based on the event type. You can listen for these events anywhere you normally would — in a listener, a service provider, or anEventServiceProvider:
payload property with the webhook data sent by SendKit.
Available events
| Event class | Webhook type | Triggered when |
|---|---|---|
EmailSent | email.sent | Email accepted for delivery |
EmailDelivered | email.delivered | Email delivered to recipient |
EmailBounced | email.bounced | Email bounced |
EmailComplained | email.complained | Recipient marked as spam |
EmailOpened | email.opened | Recipient opened the email |
EmailClicked | email.clicked | Recipient clicked a link |
EmailFailed | email.failed | Email failed to send |
EmailDeliveryDelayed | email.delivery_delayed | Delivery is taking longer than usual |
EmailRejected | email.rejected | Email was rejected |
ContactCreated | contact.created | Contact was created |
ContactUpdated | contact.updated | Contact was updated |
ContactDeleted | contact.deleted | Contact was deleted |
SendKit\Laravel\Events namespace.
Advanced configuration
For full control over the webhook configuration, publish the config file:config/sendkit.php file where you can customize the webhook path, secret, and other options.
