• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Event handler for subscription created

eworksmedia

New Pleskian
Which Event Handler gets fired when a subscription is created? I've tried both "Hosting settings created" and "Default domain (the first domain added to a subscription/webspace) created" but those don't seem to be firing when I create a new subscription. After creating the Event Handler the psa service was restarted each time. I have a script setup to just log the NEW_DOMAIN_NAME to a file, but that isn't happening.
 
I too am experiencing this very same problem. I need to run a script that automates a few things each time a new domain is created for a new subscription, but I can't seem to find the correct event trigger. I've tried a couple, including "Hosting settings created" and "Default domain (the first domain added to a subscription/webspace) created" to no avail.

Has anybody had any luck with this yet? Are there any log files I can look at to see if the event listener is even being triggered?

Cheers,
Pedro
 
This is how I solved it. Save a file like this:

Code:
class MYEventListener_EventListener implements EventListener {
	
	private static $domain_name = '';
	
	public function handleEvent($objectType, $objectId, $action, $oldValues, $newValues) { // called for all Plesk events
		if($action == 'phys_hosting_create'){ // subscription created
			self::$domain_name = $newValues['Domain Name'];
		}
	}
	
}

return new MYEventListener_EventListener();

To
Code:
/usr/local/psa/admin/plib/registry/EventListener/MYEventListener.php
 
Thanks for the quick reply. I eventually found the error. I was a stupid typo in the command field. One of those you read over and over and all is fine in your head, until another person reads it and spots the error... :(
 
Back
Top