Binds icanboogie/prototype to ICanBoogie.
The icanboogie/bind-mailer package binds icanboogie/mailer to ICanBoogie,
using its Autoconfig feature. It provides a configuration synthesizer for
mailer config and prototype bindings for the Core instance.
<?php namespace ICanBoogie; require 'vendor/autoload.php'; $app = boot(); $config = $app->configs['mailer']; // obtain the "mailer" config. $config['deliverer']; // class name or callable to create the deliverer instance. $config['mailer']; // class name or callable to create the mailer instance. $app->mailer; //instance of ICanBoogie\Mailer\Mailer; $app->mail([ 'to' => "email@example.com", 'from' => "firstname.lastname@example.org", 'subject' => "Testing", 'body' => "Hello world!" ], $options = );
sender is defined in the
mail() options the following events are triggered:
<class>:mail:beforeevent of class BeforeMailEvent is fired before the message is sent by the mailer. Third parties may use this event to alter the message or the mailer that will be used to send it.
<class>:mailevent of class MailEvent is fired after the message was sent by the mailer. Third parties may use this event to alter the result returned by the mailer.
<class> is the class of the sender.
The package requires PHP 5.5 or later.
The recommended way to install this package is through Composer:
$ composer require icanboogie/bind-mailer
The package only specifies a minimum version while requiring icanboogie/icanboogie and [icanboogie/prototype], you might want to specify which version to use in your "composer.json" file.
The package is available on GitHub, its repository can be cloned with the following command line:
$ git clone https://github.com/ICanBoogie/bind-mailer.git
The package is documented as part of the ICanBoogie framework
documentation. You can generate the documentation for the package
and its dependencies with the
make doc command. The documentation is generated in the
build/docs directory. ApiGen is required. The directory can later be
cleaned with the
make clean command.
The test suite is ran with the
make test command. PHPUnit and
Composer need to be globally available to run the suite. The command
installs dependencies as required. The
make test-coverage command runs test suite and also
creates an HTML coverage report in "build/coverage". The directory can later be cleaned with
make clean command.
The package is continuously tested by Travis CI.
icanboogie/bind-mailer is licensed under the New BSD License - See the LICENSE file for details.