We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I get an error when I try to mark as read any notification
The text was updated successfully, but these errors were encountered:
//------------------AccountNotification---------------------
namespace app\notifications;
use Yii; use webzop\notifications\Notification;
class AccountNotification extends Notification { const KEY_NEW_ACCOUNT = 'new_account';
const KEY_RESET_PASSWORD = 'reset_password'; const KEY_NEW_MESSAGE = 'new_message'; /** * @var \yii\web\User the user object */ public $user; public $message; /** * @inheritdoc */ public function getTitle(){ switch($this->key){ case self::KEY_NEW_ACCOUNT: return Yii::t('app', 'New account {user} created', ['user' => '#'.$this->user->id]); case self::KEY_RESET_PASSWORD: return Yii::t('app', 'Instructions to reset the password'); case self::KEY_NEW_MESSAGE: return Yii::t('app', '{message}', ['message' => $this->message]); } }
}
//------------Create a notification message---------------------
$user = User::findOne(['id' => $id]); $notification = AccountNotification::create(AccountNotification::KEY_NEW_MESSAGE, ['user' => $user, 'message' => $model->message]); $notification->setUserId($id); $notification->send();
Sorry, something went wrong.
No branches or pull requests
I get an error when I try to mark as read any notification
The text was updated successfully, but these errors were encountered: