Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

astroshippers/notion-notification-channel

Open more actions menu

Repository files navigation

Installation

composer require astroshippers/notion-notification-channel

Usage

Inside eloquent model:

public function routeNotificationForNotion(): array
{
    return [
        'token'    => config('services.notion.token'),
        'database' => '8e12b788392e4367b0532c9abb519133',
    ];
}

Inside notification class:

use NotificationChannels\Notion\{NotionChannel, NotionDatabaseItem};
use NotificationChannels\Notion\Properties\{Checkbox, Email, MultiSelect, Number, RichText, Status, Title, URL};

public function via($notifiable)
{
    return [NotionChannel::class];
}

public function toNotion(User $notifiable): NotionDatabaseItem
{
    return NotionDatabaseItem::create()
        ->properties([
            'Name'          => Title::make('John Doe'),
            'Email'         => Email::make('demo@email.com'),
            'SomeNumber'    => Number::make(12345),
            'Tags'          => MultiSelect::make(['blah', 'blah2', 'blah3']),
            'True or False' => Checkbox::make(false),
            'URL'           => URL::make('https://developers.notion.com/reference/property-value-object'),
            'Some Text'     => RichText::make([
                [
                    "type" => "text",
                    "text" => [
                        "content" => "Some more text with ",
                    ]
                ],
            ]),
        ]);
}

About

Notion.so notifications channel for Laravel

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.