• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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