Skip to content

Commit 9cd5646

Browse files
committed
wip
1 parent 80db84f commit 9cd5646

File tree

2 files changed

+47
-73
lines changed

2 files changed

+47
-73
lines changed

README.md

Lines changed: 44 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,52 @@
1-
Please see [this repo](https://github.com/laravel-notification-channels/channels) for instructions on how to submit a channel proposal.
2-
3-
# A Boilerplate repo for contributions
4-
5-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-notification-channels/:package_name.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/:package_name)
6-
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
7-
[![Build Status](https://img.shields.io/travis/laravel-notification-channels/:package_name/master.svg?style=flat-square)](https://travis-ci.org/laravel-notification-channels/:package_name)
8-
[![StyleCI](https://styleci.io/repos/:style_ci_id/shield)](https://styleci.io/repos/:style_ci_id)
9-
[![SensioLabsInsight](https://img.shields.io/sensiolabs/i/:sensio_labs_id.svg?style=flat-square)](https://insight.sensiolabs.com/projects/:sensio_labs_id)
10-
[![Quality Score](https://img.shields.io/scrutinizer/g/laravel-notification-channels/:package_name.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-notification-channels/:package_name)
11-
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/laravel-notification-channels/:package_name/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-notification-channels/:package_name/?branch=master)
12-
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-notification-channels/:package_name.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/:package_name)
13-
14-
This package makes it easy to send notifications using [:service_name](link to service) with Laravel 5.5+, 6.x and 7.x
15-
16-
**Note:** Replace ```Notion``` ```:service_name``` ```:author_name``` ```:author_username``` ```:author_website``` ```:author_email``` ```:package_name``` ```:package_description``` ```:style_ci_id``` ```:sensio_labs_id``` with their correct values in [README.md](README.md), [CHANGELOG.md](CHANGELOG.md), [CONTRIBUTING.md](CONTRIBUTING.md), [LICENSE.md](LICENSE.md), [composer.json](composer.json) and other files, then delete this line.
17-
**Tip:** Use "Find in Path/Files" in your code editor to find these keywords within the package directory and replace all occurences with your specified term.
18-
19-
This is where your description should go. Add a little code example so build can understand real quick how the package can be used. Try and limit it to a paragraph or two.
20-
21-
22-
23-
## Contents
24-
25-
- [Installation](#installation)
26-
- [Setting up the :service_name service](#setting-up-the-:service_name-service)
27-
- [Usage](#usage)
28-
- [Available Message methods](#available-message-methods)
29-
- [Changelog](#changelog)
30-
- [Testing](#testing)
31-
- [Security](#security)
32-
- [Contributing](#contributing)
33-
- [Credits](#credits)
34-
- [License](#license)
35-
36-
371
## Installation
382

39-
Please also include the steps for any third-party service setup that's required for this package.
40-
41-
### Setting up the :service_name service
42-
43-
Optionally include a few steps how users can set up the service.
3+
```shell
4+
composer require astroshippers/notion-notification-channel
5+
```
446

457
## Usage
468

47-
Some code examples, make it clear how to use the package
9+
Inside eloquent model:
4810

49-
### Available Message methods
50-
51-
A list of all available options
52-
53-
## Changelog
54-
55-
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
56-
57-
## Testing
58-
59-
``` bash
60-
$ composer test
11+
```php
12+
public function routeNotificationForNotion(): array
13+
{
14+
return [
15+
'token' => config('services.notion.token'),
16+
'database' => '8e12b788392e4367b0532c9abb519133',
17+
];
18+
}
6119
```
6220

63-
## Security
64-
65-
If you discover any security related issues, please email :author_email instead of using the issue tracker.
66-
67-
## Contributing
68-
69-
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
70-
71-
## Credits
72-
73-
- [:author_name](https://github.com/:author_username)
74-
- [All Contributors](../../contributors)
75-
76-
## License
77-
78-
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
21+
Inside notification class:
22+
23+
```php
24+
use NotificationChannels\Notion\{NotionChannel, NotionDatabaseItem};
25+
use NotificationChannels\Notion\Properties\{Checkbox, Email, MultiSelect, Number, RichText, Status, Title, URL};
26+
27+
public function via($notifiable)
28+
{
29+
return [NotionChannel::class];
30+
}
31+
32+
public function toNotion(User $notifiable): NotionDatabaseItem
33+
{
34+
return NotionDatabaseItem::create()
35+
->properties([
36+
'Name' => Title::make('John Doe'),
37+
'Email' => Email::make('[email protected]'),
38+
'SomeNumber' => Number::make(12345),
39+
'Tags' => MultiSelect::make(['blah', 'blah2', 'blah3']),
40+
'True or False' => Checkbox::make(false),
41+
'URL' => URL::make('https://developers.notion.com/reference/property-value-object'),
42+
'Some Text' => RichText::make([
43+
[
44+
"type" => "text",
45+
"text" => [
46+
"content" => "Some more text with ",
47+
]
48+
],
49+
]),
50+
]);
51+
}
52+
```

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "laravel-notification-channels/notion",
3-
"description": ":package_description",
2+
"name": "astroshippers/notion-notification-channel",
3+
"description": "Notion Notifications driver",
44
"homepage": "https://github.com/laravel-notification-channels/notion",
55
"license": "MIT",
66
"authors": [
77
{
88
"name": "Ostap",
99
"email": "[email protected]",
10-
"homepage": ":author_website",
10+
"homepage": "github.com/osbre",
1111
"role": "Developer"
1212
}
1313
],

0 commit comments

Comments
 (0)