Create a plugin (probably a local plugin), that includes an event handler, handling the event \core\event\user_enrolment_created.
You can then call whatever external script you want with the details passed into the event.
Create a plugin (probably a local plugin), that includes an event handler, handling the event \core\event\user_enrolment_created.
You can then call whatever external script you want with the details passed into the event.