2amigos / Mailer Library
Mailer
Many times we face a requirement to implement queue mail functionality in our projects. There are queue and
mailing libraries, but there seemed to be none that could actually suit our needs and moreover, we always had to sync their
functionality together.
The Mailer
library was built to fill the gaps that we have faced when implementing queue and/or mailing systems. It
features:
- message encryption/decryption just in case a mail message contains data that should not be publicly exposed. Perfect for SAS systems.
- queueing on different backends (currently supporting beanstalkd, pdo, redis and sqs) so we are not forced to use a queue storage due to the narrowed capabilities of the framework and/or libraries
- unified system. Basic to Middle size projects do have mailing but they do not require another type of queue system. That's the reason the queue system is not standalone and is coupled with this system.
Installation
The preferred way to install this extension is through composer.
Either run
$ composer require 2amigos/mailer
or add
"2amigos/mailer": "^1.0"
to the require
section of your composer.json
file.
Usage
Contributing
Please see CONTRIBUTING for details.
Clean code
We have added some development tools for you to contribute to the library with clean code:
- PHP mess detector: Takes a given PHP source code base and look for several potential problems within that source.
- PHP code sniffer: Tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
- PHP code fixer: Analyzes some PHP source code and tries to fix coding standards issues.
And you should use them in that order.
Using php mess detector
Sample with all options available:
./vendor/bin/phpmd ./src text codesize,unusedcode,naming,design,controversial,cleancode
Using code sniffer
./vendor/bin/phpcs -s --report=source --standard=PSR2 ./src
Using code fixer
We have added a PHP code fixer to standardize our code. It includes Symfony, PSR2 and some contributors rules.
./vendor/bin/php-cs-fixer --config-file=.php_cs fix ./src
Testing
$ ./vendor/bin/phpunit
Credits
License
The BSD License (BSD). Please see License File for more information.
web development has never been so fun
www.2amigos.us