2017 © Pedro Peláez
 

library email-service-php-client

PHP client to interact with our Email Service API: https://github.com/silinternational/email-service

image

silinternational/email-service-php-client

PHP client to interact with our Email Service API: https://github.com/silinternational/email-service

  • Thursday, December 7, 2017
  • by fillup
  • Repository
  • 5 Watchers
  • 0 Stars
  • 1,884 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 6 Versions
  • 149 % Grown

The README.md

email-service-php-client

PHP client to interact with our Email Service's API., (*1)

This client is built on top of Guzzle, the PHP HTTP Client. Guzzle has a simple way to create API clients by describing the API in a Swagger-like format without the need to implement every method yourself. So adding support for more APIs is relatively simple., (*2)

Install

Installation is simple with Composer:, (*3)

$ composer require silinternational/email-service-php-client

Usage

Example:, (*4)

<?php

use Sil\EmailService\Client\EmailServiceClient;

$emailServiceClient = new EmailServiceClient(
    'https://api.example.com/', // The base URI for the API.
    'DummyAccessToken', // Your HTTP header authorization bearer token.
    [
        'http_client_options' => [
            'timeout' => 10, // An (optional) custom HTTP timeout, in seconds.
        ],
    ]
);

$email = $emailServiceClient->email([
    "to_address" => "test@domain.com",
    "cc_address" => "other@domain.com",   // optional
    "bcc_address" => "bcc@domain.com",    // optional
    "subject" => "Test Subject",
    "text_body" => "this is text",        // either text_body or html_body is required, but both can be provided
    "html_body" => "<b>this is html</b>",
]);

To send an email with a delay of a fixed amount of time:`, (*5)

$email = $emailServiceClient->email([
    "to_address" => "test@domain.com",
    "subject" => "Test Subject",
    "html_body" => "<b>this is html</b>",
    "delay_seconds" => "3600",
]);

Or to schedule an email, use send_after with a Unix timestamp:, (*6)

$email = $emailServiceClient->email([
    "to_address" => "test@domain.com",
    "subject" => "Test Subject",
    "html_body" => "<b>this is html</b>",
    "send_after" => "1556825944",
]);

Tests

To run the unit tests for this, run make test., (*7)

Guzzle Service Client Notes

The Versions

07/12 2017

dev-master

9999999-dev

PHP client to interact with our Email Service API: https://github.com/silinternational/email-service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Henderson

api email php client

07/12 2017

2.0.2

2.0.2.0

PHP client to interact with our Email Service API: https://github.com/silinternational/email-service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Henderson

api email php client

07/12 2017

dev-develop

dev-develop

PHP client to interact with our Email Service API: https://github.com/silinternational/email-service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Henderson

api email php client

23/08 2017

2.0.1

2.0.1.0

PHP client to interact with our Email Service API: https://github.com/silinternational/email-service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Henderson

api email php client

11/08 2017

2.0.0

2.0.0.0

PHP client to interact with our Email Service API: https://github.com/silinternational/email-service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Henderson

api email php client

24/07 2017

1.0

1.0.0.0

PHP client to interact with our Email Service API: https://github.com/silinternational/email-service

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Henderson

api email php client