Skip to content

mauthi/laravel-asana-notification

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asana notifications channel for Laravel 5.6

Latest Version on Packagist Software License Build Status StyleCI SensioLabsInsight Quality Score Code Coverage Total Downloads

This package makes it easy to send notifications using Asana with Laravel 5.6.

Contents

Installation

You can install the package via composer:

composer require laravel-notification-channels/asana

Setting up the Asana service

Once installed you need to register the service provider with the application. Open up config/app.php and find the providers key.

'providers' => [

    \Torann\LaravelAsana\ServiceProvider::class,

]

Run this on the command line from the root of your project:

$ php artisan vendor:publish --provider="Torann\LaravelAsana\ServiceProvider" --tag=config

A configuration file will be publish to config/asana.php.

Add your Asana Token to .env

ASANA_TOKEN=xxx

Usage

Now you can use the channel in your via() method inside the notification:

use NotificationChannels\Asana\AsanaChannel;
use NotificationChannels\Asana\AsanaMessage;
use Illuminate\Notifications\Notification;

class TestNotification extends Notification
{
    public function via($notifiable)
    {
        return [AsanaChannel::class];
    }

    public function toAsana($notifiable)
    {
        return AsanaMessage::create("Test Task")
            ->notes("Description of task ...")
            ->assignee("[email protected]")
            ->dueOn(new \DateTime());
    }
}

Available methods

  • name(''): Accepts a string value for the Asana task title.
  • notes(''): Accepts a string value for the Asana task notes (default: '').
  • assignee(''): Accepts either email address of an asana user or user id.
  • workspace(''): Accepts a string value for the Asana workspace (default: config.asana.workspaceId).
  • projects(''): Accepts a string value for a single Asana project or an array of project ids (default: config.asana.projectId).
  • dueOn(''): Accepts a string or DateTime object for the Asana task due date.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

About

Submit pull requests here for new notification channels

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%