Skip to content

Commit 38bda2c

Browse files
committed
Update TextlocalChannel.php
Update README.md Update CHANGELOG.md
1 parent be0bc25 commit 38bda2c

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to `Textlocal` will be documented in this file
44

5+
6+
## 2.4.0 - 2022-08-17
7+
8+
`public function getSenderId($notifiable)`
9+
10+
method has changed from `public function getSenderId()`, so now the notifiable is passed as parameter
11+
giving more control to the imeplementation to decide based on user/recipent in case want to use some alternate deciding factor
12+
513
## 0.0.1 - 2017-08-07
614

715
- initial release

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ return [
5555
// extra config define keys as desired for use within the textlocal client config
5656
// if you want to use the custom client config for each notification or notifiable
5757
// INotificationUsesTextlocalClientConfig
58-
]
59-
];
60-
```
58+
]public function getSenderId($notifiable)
6159
### Configuring .env
6260
```
6361
TEXTLOCAL_USERNAME=Your email id or api key
@@ -121,12 +119,13 @@ Notification::route('Textlocal', $mobileNo')->notify(new VerifyMobileNotificatio
121119

122120
And if you want to have a specific sender based on Notification, e.g. like you are sending promotional notification using one and another for transaction then you can just define this method in your notification class which will return your sender id for that notification only
123121
```
124-
public function getSenderId()
122+
public function getSenderId($notifiable)
125123
{
126124
return 'YOUR_SENDER_ID';
127125
}
128126
```
129127

128+
130129
Unicode support
131130
If you want to send the notification content to have unicode support. Define this method in your notification which will return boolean based on which the sms will set the unicode mode in textlocal API
132131
```

src/TextlocalChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function send($notifiable, Notification $notification)
6565
}
6666

6767
if (method_exists($notification, 'getSenderId')) {
68-
$this->sender = $notification->getSenderId();
68+
$this->sender = $notification->getSenderId($notifiable);
6969
}
7070

7171
$client = $this->getClient($notifiable, $notification);

0 commit comments

Comments
 (0)