Download the PHP package rnevarezc/postal without Composer

On this page you can find all versions of the php package rnevarezc/postal. 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 postal

Postal API Client

This library helps you use the Postal API in PHP 7.2 (and above) to send Emails, get Message Details & Deliveries and Implement Events to handle Server Webhooks.

It uses GuzzleHTTP client and PSR-7: HTTP-PSR7 interfaces.

Installation

Install the library using Composer:

Usage

Using the Client

You will need an API Credential from your Postal Installation to use the API Client.

Sending an Email

Sending an email is simple. You can follow the example below:

Or Create a new mail message and add manually each of the Mail attributes

If you'd like to capture the Messages Dispatched for each recipient of the Mail. You can do it like so:

Getting Message Details

You can get the Details of a Message using the Client. You just need the Message ID

Getting Message Deliveries

You can get the Deliveries of a Message using the Client. You just need the Message ID

Events and Webhooks!

This library provides support for all the type of Payloads that a Postal Installation can send via Webhooks.

You must configure your postal Installation to send those events to an URL of your choice to be able to use this library.

You can get more information about Webhooks and Payloads in the Postal Documentation

Message Status Events, Bounces & Click Events

Message Status events all receive the same payload (with different data) based on the status of a message.

The Class is a Factory that can Parse a Payload of any of these events and build the correct Event Implementation.

Capturing these Events in an Handler (or a Controller) is very easy. You could define a Class in your app and capture the request like this:

If you capture the POST payload in any other way you could send that payload to the Factory directly to build an Event:

If a invalid Payload is provided, an is thrown

Using the .

Depending on the Event Type you get an Concrete Implementation of the . The defined types (and their clases) are the same provided by Postal:

MessageBounced Event:

Server Events

If you'd like to capture a event you can use that specific Event Class:

The same way, if you'd like to capture any kind of SendLimit Event, you can do it via the Static Methods defined in the Factory Class:

or

The $event variable will have the correct Event depending on the Payload.

It is strongly recommended to use different Handlers (or Controllers) by type of Event and don't use a Common webhook URL to handle them all!

API Information

You can get more information about the Postal API and Payloads in the Postal Project Wiki


All versions of postal with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
guzzlehttp/guzzle Version ^7.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 rnevarezc/postal contains the following files

Loading the files please wait ....