XF 2.2 Alert Not Showing

Gon45

Member
Hello, I am having some trouble with an addon.

I put this into my addon code:

Code: $alertRepo = $this->repository('XF:UserAlert');
$alertRepo->alertFromUser(
$user,
$giver,
'cards',
$card_id,
'awarded',
$extra
);

And the alert gets added to the database and the bell gets a little 1 but no alert shows. I have created alert_cards_awarded as well as the alert_handler_class and entity. The only thing I think it could be is the Alert file which as the following:

Code: <?php

namespace Cards\Alert;

use XF\Mvc\Entity\Entity;

class Award extends \XF\Alert\AbstractHandler
{
public function canViewContent(Entity $entity, &$error = null)
{
return true;
}
}


Can I get any advice on this?
 
Top Bottom