Download the PHP package sendlayer/sendlayer-php without Composer

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

SendLayer Logo

SendLayer PHP SDK

The official PHP SDK for interacting with the SendLayer API, providing a simple and intuitive interface for sending emails, managing webhooks, and retrieving email events.

Features

Installation

Using Composer (Recommended)

Manual Installation

  1. Download the SDK
  2. Include the autoloader in your project
  3. Install dependencies: composer install

Quick Start

Configuration (Optional)

You can pass additional configuration options when initializing the SDK:

Email Sending

Basic Email

HTML Email

HTML Email with Plain-Text Fallback

Pass both html and text to send a message that carries an HTML part for clients that render it and a plain-text alternative for those that don't. Recommended for deliverability.

Both parts are sent; ContentType is reported to the API as HTML whenever an HTML body is present, and as Text when only text is supplied.

Email with Sender Name

Multiple Recipients

Email with CC and BCC

Email with Attachments

Email with Custom Headers and Tags

Webhook Management

Create a Webhook

Get All Webhooks

Delete a Webhook

Event Tracking

Get All Events

Get Events with Filters

Get Events for Specific Message

Error Handling

The SDK provides specific exception types for different error scenarios:

When the API returns errors, the SDK preserves them on the exception's $errors property as the raw Errors entries from the response (each with a numeric Code and a Message):

$errors is declared on the base SendLayerException, so it is available on every exception type. It is an empty array when the SDK raises the error locally (client-side validation, connection failures) and when the API returns a body that isn't the JSON Errors shape, so guard with empty($e->errors) before relying on it.

getMessage() returns the API's message text verbatim for the specific exception types listed below, joining multiple messages with ;. The one exception is SendLayerAPIException, which prefixes its message with API Error {status}:. When the response body isn't JSON, the message falls back to the HTTP reason phrase (e.g. Bad Request).

The numeric Code values are a fixed set defined by the API — see the SendLayer error codes reference for the full table (14 = recipient suppressed, 17 = email quota reached, 32 = domain not activated, and so on).

Exception Types

getCode() carries the HTTP status code of the response, with one caveat: a 422 response raises a SendLayerValidationException whose code is 400, since both statuses map to that type. Match on the exception class, or on the Code values in $errors, rather than on getCode() when you need to tell them apart.

Supported Events

Webhook Events

Event Tracking Events

Requirements

License

This SDK is licensed under the MIT License. See the LICENSE file for details.

Support

For support, please contact:

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Changelog

See CHANGELOG.md for a list of changes and version history.


All versions of sendlayer-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
guzzlehttp/guzzle Version ^7.0 || ^8.0
ext-json Version *
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 sendlayer/sendlayer-php contains the following files

Loading the files please wait ...