Download the PHP package keneasson/php-sparkpost without Composer

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

Sign up for a SparkPost account and visit our Developer Hub for even more content.

SparkPost PHP Library

Travis CI Coverage Status Slack Status

The official PHP library for using the SparkPost REST API.

Note: We understand that the ivory-http-adapter we use in this library is deprecated in favor of httplug. We use Ivory internally to make it simple for you to use whatever HTTP library you want. The deprecation won't affect or limit our ongoing support of this PHP library.

Before using this library, you must have a valid API Key. To get an API Key, please log in to your SparkPost account and generate one in the Settings page.

Installation

The recommended way to install the SparkPost PHP Library is through composer.

Next, run the Composer command to install the SparkPost PHP Library:

After installing, you need to require Composer's autoloader:

Setting up a Request Adapter

Because of dependency collision, we have opted to use a request adapter rather than requiring a request library. This means that your application will need to pass in a request adapter to the constructor of the SparkPost Library. We use the [Ivory HTTP Adapter] (https://github.com/egeloen/ivory-http-adapter) in SparkPost. Please visit their repo for a list of supported adapters. If you don't currently use a request library, you will need to require one and create an adapter from it and pass it along. The example below uses the GuzzleHttp Client Library.

An Adapter can be setup like so:

Getting Started: Your First Mailing

For this example to work as is, Guzzle 6 will need to be installed. Otherwise another adapter can be used for your specific setup. See "Setting up a Request Adapter" above.

Learn More

Field Descriptions

Transmissions

Field Name Required? Description Data Type
attachments no Field for attaching files - see Attachment Attributes in the Transmssions API docs Array of Objects
campaign no Field for assigning a given transmission to a specific campaign, which is a logical container for similar transmissions String
customHeaders no Field for specifying additional headers to be applied to a given transmission (other than Subject, From, To, and Reply-To) Object (Simple)
description no Field for describing what this transmission is for the user String
from yes** Field for setting the from line of a given transmission Object
html yes** Field for setting the HTML content of a given transmission String
inlineCss no Field for enabling/disabling CSS inlining Boolean
inlineImages no Field for providing inline images - see Inline Image Attributes in the Transmssions API docs Array of Objects
metadata no Field for adding arbitrary key/value pairs which will be included in open/click tracking Object (Simple)
recipientList no** Field for specifying a stored recipient list ID to be used for a given transmission String
recipients yes** Field for specifying who a given transmission should be sent to Array of Objects
replyTo no Field for specifying the email address that should be used when a recipient hits the reply button String
rfc822 no** Field for setting the RFC-822 encoded content of a given transmission String
subject yes Field for setting the subject line of a given transmission String
substitutionData no Field for adding transmission level substitution data, which can be used in a variety of fields and in content Object (Complex)
template no** Field for specifying the Template ID of a stored template to be used when sending a given transmission String
text yes** Field for setting the Plain Text content of a given transmission String
trackClicks no Field for enabling/disabling transmission level click tracking (default: true) Boolean
trackOpens no Field for enabling/disabling transmission level open tracking (default: true) Boolean
transactional no Field for marking email as transactional (default: false) Boolean
useDraftTemplate no Field for allowing the sending of a transmission using a draft of a stored template (default: false) Boolean

** - If using inline content then html or text are required. If using RFC-822 Inline Content, then rfc822 is required. If using a stored recipient list, then recipientList is required. If using a stored template, then template is required but from is not as the values from the template will be used.

Tips and Tricks

General

Transmissions

Contributing

See contributing.


All versions of php-sparkpost with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
egeloen/http-adapter 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 keneasson/php-sparkpost contains the following files

Loading the files please wait ....