I am developing a site using moodle on behalf of a client, who requires that every time the user wants to enroll in a course they must first verify their email (I know it is a request that does not make much sense, but what he says is an essential thing).
The only possible solution that came to my mind was to put a different enrollment key for each course, and on the enrollment page (the one where it asks you for the key) add by code a button that if pressed calls an external script ( like an ajax call) which sends the key to the user's email, the problem is that I realized that maybe it's not possible to retrieve the secret key on that page. Does anyone know of another way to perform this action? Solutions that require coding are also welcome. Thanks in advance.