i'm creating my first extension.
my extension make the admin editing the
phpbb_user table
in the column user_donatore
.It works correctly but i want to send a notification to the user related of this editing.
Like:
- admin edits the column
user_donatore
for the user "sebo"- user sebo has to get the notification of this editing
so:
(i'm quite new to PHP and this is my first extension, so it's quite difficult for me, but i'm trying to learn...

i read this tutorial
https://area51.phpbb.com/docs/dev/3.3.x ... tions.html
i edited the file service.yml
- '@notification_manager'
to get notification into the acp_controland
Code: Select all
sebo.donatore.notification.type.attiva:
class: sebo\donatore\notification\type\attiva
shared: false # service MUST not be shared for this to work!
parent: notification.type.base
calls:
- [set_controller_helper, ['@controller.helper']]
tags:
- { name: notification.type }

after i've included in the acp_control.php
Code: Select all
/** @var \phpbb\notification\manager */
protected $notification_manager;
Code: Select all
public function __construct(\phpbb\notification\manager $notication_manager)
{
$this->notification_manager = $notification_manager;
}
like i said before, this function is:
- after the acp edit the db (changing the column "user_donatore" in table "phpbb_users"), it has to set a notification for the user that the column has been changed...so i've tried to start what to write...maybe something like
Code: Select all
$this->notification_manager->add_notifications('sebo.donatore.notification.type.attiva', [
'user_id' => 'user_id',
'sender_id' => 'user_admin_id',
'message_subject' => 'notifica_subject',
]);
what do i miss?!?![phpBB Debug] PHP Warning: in file [ROOT]/ext/sebo/donatore/controller/acp_controller.php on line 67: Undefined variable $notification_manager
