mrjulio/rapture-message

Rapture message component

v1.0.1 2017-11-18 20:57 UTC

This package is not auto-updated.

Last update: 2024-11-02 15:54:01 UTC


README

PhpVersion License

Message sending for various services.

Requirements

  • PHP v7.0.0
  • php-curl, php-json, php-soap

Install

composer require mrjulio/rapture-message

Quick start

$message= new Message([
    'subject'   =>  'Hello',
    'body'      =>  'Lorem ipsum...'
]);
$message->setSender('no-reply@gmail.com');

$mailgun = new Mailgun(['api-key' => '98asd0as09ds']);
$request = $mailgun->getRequest($message);
$client  = new \Rapture\Http\Client;

$response = $httpClient->sendRequest($request);

if ($response->getStatusCode() === \Rapture\Http\Response::STATUS_OK) {
    echo 'Success!';
}
else {
    echo 'Failed!';
}

About

Author

Iulian N. rapture@iuliann.ro

Testing

cd ./test && phpunit

License

Rapture PHP Message is licensed under the MIT License - see the LICENSE file for details.