diff --git a/like/notifications/Like_OnLikeEntriesNotification.php b/like/notifications/Like_OnLikeEntriesNotification.php index 4ad911e..e04bcf8 100644 --- a/like/notifications/Like_OnLikeEntriesNotification.php +++ b/like/notifications/Like_OnLikeEntriesNotification.php @@ -18,9 +18,9 @@ public function event() */ public function action(Event $event) { - $liker = craft()->userSession->getUser(); + $contextUser = craft()->userSession->getUser(); - if(!$liker) { + if(!$contextUser) { return; } @@ -30,11 +30,12 @@ public function action(Event $event) return; } - $to = $element->author; + $user = $element->author; - $variables['user'] = $liker; + $variables['user'] = $user; + $variables['contextUser'] = $contextUser; $variables['entry'] = $element; - craft()->notifications->sendNotification($this->getHandle(), $to, $variables); + craft()->notifications->sendNotification($this->getHandle(), $user, $variables); } } \ No newline at end of file diff --git a/like/notifications/Like_OnLikeMeNotification.php b/like/notifications/Like_OnLikeMeNotification.php index 3ac5b19..8958eee 100644 --- a/like/notifications/Like_OnLikeMeNotification.php +++ b/like/notifications/Like_OnLikeMeNotification.php @@ -18,9 +18,9 @@ public function event() */ public function action(Event $event) { - $liker = craft()->userSession->getUser(); + $contextUser = craft()->userSession->getUser(); - if(!$liker) { + if(!$contextUser) { return; } @@ -30,10 +30,11 @@ public function action(Event $event) return; } - $to = $element; + $user = $element; - $variables['user'] = $liker; + $variables['user'] = $user; + $variables['contextUser'] = $contextUser; - craft()->notifications->sendNotification($this->getHandle(), $to, $variables); + craft()->notifications->sendNotification($this->getHandle(), $user, $variables); } } \ No newline at end of file