Skip to content

Commit aa57eb7

Browse files
committed
Readme
1 parent 65555fb commit aa57eb7

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Pishmix Web Push Notifications Service for Laravel
1+
## Laravel package for simpliefied integration with Pishmix web push notification service.
22

33
## About
44

@@ -16,7 +16,7 @@ This package integrates Pushmix service with Laravel applications providing foll
1616

1717
Create subscription at [Pushmix](https://www.pushmix.co.uk), copy your `subscription_id` and paste into `.env` file.
1818
```bash
19-
PUSHMIX_SUBSCRIPTION_ID=MY_SUBSCRIPTION_ID
19+
PUSHMIX_SUBSCRIPTION_ID=ADD_YOUR_PUSHMIX_ID
2020
```
2121

2222
The preferred method of installation is via Composer. Run the following command to install the package to your project's `composer.json`:
@@ -30,9 +30,13 @@ Publish package assets and you good to go.
3030
php artisan vendor:publish --provider="Pushmix\WebNotification\PushmixServiceProvider"
3131
```
3232

33-
## Display Opt In Prompt
33+
## Displaying Opt In Prompt
3434

35-
Display opt in prompt to your website visitor by including it into your template. Alternatively you can manually copy and paste content of `vendor.pushmix.optin` into template. Preview in the web browser to ensure that opt in prompt is trigegred. Please note that web browser must be compatible with Push API, otherwise opt in prompt will not be displayed.
35+
To display opt in prompt you will need to include block of javascrip into your template using Blade `@include` derictive.
36+
37+
Alternatively you can copy and paste content of `vendor.pushmix.optin` into template.
38+
39+
Preview in the web browser to ensure that opt in prompt is trigegred. Please note that web browser must be compatible with Push API, otherwise opt in prompt will not be displayed.
3640

3741
```bash
3842
<body>
@@ -57,7 +61,7 @@ Display opt in prompt to your website visitor by including it into your template
5761
## Sending Message
5862
Sending message to your subscribers is simple. First add reference to Pushmix class, than create an array with four requiried parameters.
5963

60-
* `topic` - defines audience you would like to target, see bellow Retrieving Topics
64+
* `topic` - defines audience you would like to target, see bellow Subscription Topics
6165
* `title` - notification title, keep it short
6266
* `body` - notification body content, keep it short
6367
* `default_url` - valid URL, will used when user click on the notification
@@ -103,7 +107,7 @@ class PushmixController extends Controller
103107
$msg_data = [
104108

105109
// Required Parameters
106-
'topic' => 'all', // or topic id from Pushmix::getTopics()
110+
'topic' => 'all', // or topic id from Pushmix::getTopics() call
107111
'title' => 'Hello',
108112
'body' => 'Welcome to Pushmix!',
109113
'default_url' => 'https://www.pushmix.co.uk',
@@ -153,12 +157,14 @@ class PushmixController extends Controller
153157

154158
If you haven't specified additional topics in your subscription in the Pushmix dashboard than you don't need to read this.
155159

156-
Please note: you can always edit your subscription and add/or remove topics. If you have added new topics to your subscription you will need to call this method in order to obtain your topics id's.
160+
Please note: you can always edit your subscription and add/or remove topics. If you have recently added new topics to your subscription you will need to call this method in order to obtain your topic id's.
157161

158-
Ability to send messages to all subscribers is great, but sometimes you only need to target those users who have expressed thier interest by opting in one of your topics. Audience segmentation is the solution.
162+
Ability to send messages to all subscribers is great, but sometimes you only need to target those users who have expressed thier interest by opting to one of your topics.
159163

160-
To push message to a topic subscribers first you will need to obtain topic id by calling `Pushmix::getTopics()`
161-
This call will return an array of topic names and id's or an empty array in case if you haven't created any topics.
164+
Once have created topics you can segment your audience and push message to a topic subscribers.
165+
First you will need to obtain topic id by calling `Pushmix::getTopics()`
166+
This call will return an array of topics including name and id.
167+
An empty array will be returned if you haven't created any topics.
162168

163169
```php
164170
<?php
@@ -196,7 +202,7 @@ class PushmixController extends Controller
196202
// Required Parameters
197203
'topic' => '17', // subscribers of Service Updates topic only
198204
'title' => 'New Feature',
199-
'body' => 'Use Pushmix wihin your Laravel application, see details',
205+
'body' => 'Use Pushmix within your Laravel application, see details',
200206
'default_url' => 'https://www.pushmix.co.uk/features',
201207
];
202208

0 commit comments

Comments
 (0)