Download the PHP package codekanzlei/cake-notifications without Composer

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

CakePHP 3 Notifications Plugin

Build Status Code Coverage v2-dev

A CakePHP 3.8 notification plugin which can send out emails asynchronously through to the cakephp-queuesadilla job queue.

Requirements

Installation

1. Install the plugin via composer

composer require codekanzlei/cake-notifications

2. Load the plugin in your src/Application.php

$this->addPlugin('Notifications');

3. Configure config/app.php

Set your default locale in a config file, for example in app.php. This config is mandatory and will cause an exception if not set.

You can also override the queue options like attempts, attempts_delay, delay, expires_in and queue.

This doesn't affect the use of queueOptions() later. You can still override the options there.

Also, be sure to set up the the cakephp-queuesadilla plugin config. You can find an example config here: https://cakephp-queuesadilla.readthedocs.io/en/latest/.

Or you can find available config options inside your used Engine file (vendor/josegonzalez/queuesadilla/src/josegonzalez/Queuesadilla/Engine/*Engine.php) inside the $baseConfig property.

IMPORTANT: Set "date.timezone" in your cli/php.ini to an appropriate value, else notifications with a delay_until could be sent out at the wrong time.

Usage

Email

The EmailNotification is completely compatible with the CakePHP Email.

Add the following to your class where you want to send an email:

use Notifications\Notification\EmailNotification;

Then simply create a new EmailNotification object.

You can chain all methods provided by the CakePHP Email Class http://book.cakephp.org/3.0/en/core-libraries/email.html

Additional, following functions are available:

send( array|string|null $content null )

Send out the email immediately. before- and afterSend callbacks are still available

setLocale( string|null $locale null )

Set the locale for the notification. If null, is used.

push()

Push the email into the queue to send it asynchronous

setQueueOptions( array $options null )

You can change some of the default options from the cakephp-queuesadilla plugin.

Supported options:

setBeforeSendCallback( array|string|null $class null, array $args [] )

Pass a callable as the $class parameter. Static and none-static functions are supported.

This will call the bar method inside the Foo class with two parameters before the email is send.

To manipulate the EmailNotification instance before sending, the beforeSendCallback may return a function taking the notification instance reference and for example changing the profile. The bar method may then look something like this:

setAfterSendCallback( array|string|null $class null, array $args [] )

Pass a callable as the $class parameter. Static and none-static functions are supported.

This will call the static bar method inside the Foo class with two parameters after the email was send.

addBeforeSendCallback( array|string|null $class null, array $args [] )

Add an additional callback to beforeSend.

addAfterSendCallback( array|string|null $class null, array $args [] )

Add an additional callback to afterSend.


All versions of cake-notifications with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
cakephp/cakephp Version >=3.6
josegonzalez/cakephp-queuesadilla Version ^0.4.2
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 codekanzlei/cake-notifications contains the following files

Loading the files please wait ....