Download the PHP package renatoxm/laravel-postmark-webhooks without Composer

On this page you can find all versions of the php package renatoxm/laravel-postmark-webhooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-postmark-webhooks

Handle Postmark webhooks in a Laravel application

Latest Version on Packagist Tests StyleCI Total Downloads

Postmark can send out several webhooks to your application when an event occurs.
This way Postmark is able to immediately notify you when something new occurs.

This package can help you handle those webhooks.

Installation

You can install the package via composer:

Publish config and migration files:

This package will log all incoming webhooks to the database by default.
Run the migrations to create a postmark_webhook_logs table in the database:

If you want to disable database logging you can set POSTMARK_WEBHOOKS_LOG_ENABLED=false in your .env file.

Setup webhooks with Postmark

Visit the servers page on your Postmark account. Choose the server you want to setup webhooks for.
Go to settings > webhooks > add webbook.

This package will register a route where Postmark can post their webhooks to: /api/webhooks/postmark.

Fill in your webhook URL: https://<your-domain.com>/api/webhooks/postmark
Pick the events Postmark should send to you and save the webhook.
You are ready to receive webhook notifications from Postmark!

You may change the /api/webhooks/postmark endpoint to anything you like.
You can do this by changing the path key in the config/postmark-webooks.php file.

Protection of your webhook

This package protects your webhook automatically by only allowing requests from the IP range that Postmark uses.

Disabling webhook protection

If you need to test in Development using ngrok to test Postmark webhooks you can disable the webhook entirely. To do that, add POSTMARK_WEBHOOKS_MIDDLEWARE_DISABLE=true to your .env file.

WARNING: Do not forget to enable it back in production!

Usage

Postmark can send out several event types by posting a webhook.
You can find the full list of webhooks in the Postmark documentation.

All webhook requests will be logged in the postmark_webhook_logs table.
The table has a payload column where the entire payload of the incoming webhook is saved.
The ID Postmark assigned to the original message will be saved in the message_id column,
the event type will be stored in the record_type column and the email address as well in the email column.

Note that event types will be converted to snake_case.
For example SpamComplaint will be saved as spam_complaint.

Events

Whenever a webhook call comes in, this package will fire a PostmarkWebhookCalled event.
You may register an event listener in the EventServiceProvider:

Example of a listener:

You may also register an event listener for a specific type of event:

Available events: open, bounce, click, delivery, spam_complaint.

Advanced configuration

You may optionally publish the config file with:

Within the configuration file you may change the table name being used or the Eloquent model being used to save log records to the database.

If you want to use your own model to save the logs to the database you should extend the RenatoXM\PostmarkWebhooks\PostmarkWebhook class.

You can also exclude one or more event types from being logged to the database.
Place the events you want to exclude under the except key:

You can map the events fired by this package to your own event classes:

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

Inspired by Laravel Stripe Webooks from Spatie.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-postmark-webhooks with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^10.0 || ^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package renatoxm/laravel-postmark-webhooks contains the following files

Loading the files please wait ....