We suppose that you have prepared the *Plan_Item_Interface* implementation and want to register your service with Plesk Notifications. To perform the registration, create an arbitrary PHP file, for example, `register.php`, and paste the code given below into the file. Substitute *servicedir_servicefile* with your class name throughout the code. When ready, run the code by using one of these shell commands:
- On Linux, run `/usr/local/psa/bin/sw-engine-pleskrun`` ``register.php`
- On Windows, run `%plesk_bin%\php`` ``register.php`
The definition of the parameters that present in the statement is as follows:
- *classname*, string
The name of the class that contains the interface implementation.
- *name*, string
The unique name of the service.
- *applicableToEmail,* boolean (0,1)
This parameter subscribes the service to email accounts changes. Alternatively, you can specify applicableToSite or applicableToSubscription to receive notifications about changes in Plesk’s subscriptions and sites.
- *uuid*, string
The service identifier.
Note
We suppose that Plesk is installed to the default installation directory. If you use a custom directory, please update the paths correspondingly.
To view the `register.php` code, click the following link: code sample.
If it is impossible for you to run the PHP code, you can register the service directly by running this MySQL/MariaDB statement customized to your class.
INSERT INTO PlanItems (
classname,
name,
applicableToEmail,
uuid
)
VALUES (
'servicedir_servicefile',
'urn:isv:custom-item-connector:1',
1,
'219b7656-8e92-869d-828a-6814cda71a1s');