Skip to content

Commit

Permalink
Merge pull request #15 from huo-zi/v1.0
Browse files Browse the repository at this point in the history
fix bug
  • Loading branch information
huozi1024 authored Nov 22, 2021
2 parents 8677fa6 + cdbc72b commit 289643a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Channels/WechatTemplateChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function send($notifiable, Notification $notification)
$message = $notification->{'to' . Str::studly($this->channel)}($notifiable);
if ($message instanceof WechatTemplateMessage && ! Arr::get($message->getMessage(), 'touser')) {
$message->to($notifiable->routeNotificationFor($this->channel, $notification));
} elseif ($message instanceof WechatWorkMessage && empty($message->to)) {
} elseif ($message instanceof WechatWorkMessage && empty($message->getToUser())) {
$message->toUser($notifiable->routeNotificationFor($this->channel, $notification));
}
return $message->send();
Expand Down
4 changes: 4 additions & 0 deletions src/Messages/WechatWorkMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ public function __construct($app)
parent::__construct($app);
}

public function getToUser()
{
return $this->to;
}
}

0 comments on commit 289643a

Please sign in to comment.