kittinan/php-line-notify

PHP Line Notify

0.5 2017-12-17 02:56 UTC

This package is auto-updated.

Last update: 2024-11-19 22:14:51 UTC


README

Build Status Code Coverage Scrutinizer Code Quality License: MIT

Simple PHP Line Notify Class

Line Notify Document

Requirement

Composer

Install the latest version with composer

composer require kittinan/php-line-notify

https://packagist.org/packages/kittinan/php-line-notify

Generate Line Notify Token

https://notify-bot.line.me/my/

Usage

Example : notify text message

$token = 'YOUR LINE NOTIFY TOKEN';
$ln = new KS\Line\LineNotify($token);

$text = 'Hello Line Notify';
$ln->send($text);

Example : notify text with image

$text = 'Hello Line Notify';
$image_path = '/YOUR/IMAGE/PATH'; //Line notify allow only jpeg and png file
$ln->send($text, $image_path);

//HTTP or HTTPS image path
$image_path = 'https://lorempixel.com/800/600/'; //Line notify allow only jpeg and png file
$ln->send($text, $image_path);

Example : notify text with sticker

See sticker list https://devdocs.line.me/files/sticker_list.pdf

$text = 'Hello Sticker';
$sticker = ['stickerPackageId' => '1', 'stickerId' => '401'];
$ln->send($text, null, $sticker);

Screenshot

Screenshot

License

The MIT License (MIT)