Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

czim/hellodialog

Repository files navigation

HelloDialog API Connector

Latest Version on Packagist Software License Build Status Latest Stable Version

HelloDialog API connector / handler package.

This package is no longer supported!
Please contact HelloDialog directly if you wish to make HelloDialog API connections.

Install

Via Composer

$ composer require czim/hellodialog

Then add the service provider in config/app.php:

Czim\HelloDialog\HelloDialogServiceProvider::class,

Finally publish the config using the artisan command:

$ php artisan vendor:publish

Configuration

Set the configuration in config/hellodialog.php.

Basic Usage

After installation and configuration, the HelloDialogHandler will be available to make custom calls to HelloDialog. The hellodialog mail driver is also available.

The Mail Driver

See the hellodialog.php config file for further details about configuring and using the mail driver. Note that you cannot use all mail properties using this driver (BCC does not work, for instance). As always with HelloDialog, sending to multiple addresses will result in multiple calls to the HelloDialog API and will be mailed separately.

When using the mail driver, a transactional template is expected with at least a 'content' replace, and optionally a 'title' replace. The placeholder for these may be set in the config (defaults to __CONTENT__). The entire mail view contents will be used as the 'content' replace value.

Performing Calls

To manually perform calls, instantiate the HelloDialogHandler class.

    $handler = app(\Czim\HelloDialog\Contracts\HelloDialogHandlerInterface::class);
    // or:
    $handler = new \Czim\HelloDialog\HelloDialogHandler();

Available methods are listed in the HelloDialogHandlerInterface.

Templates

Templates can be referred to by numerical ID, or the key set for their section in the config (which must have an id property set).

Logging

By default, any logging will be done using Laravel's Log facade. Alternatively, you may pass in a custom Monolog logger (anything that implements Psr\Log\LoggerInterface) when instantiating the HelloDialogHandler.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.