Notify site administrators about new Email Signups

General plugins (Local) ::: local_notifyemailsignup
Maintained by Iñaki Arenaza
This plugin sends an email notification message to the 'Support email' address every time a new Moodle user account is created via the 'Email signup' authentication plugin. The notification message contains some essential details about the account just created (email address, full name and user account name). The email is sent when the user signs up, not when the user account is confirmed. So the plugin will notify even about accounts that may never be confirmed.
Latest release:
310 sites
130 downloads
22 fans
Current versions available: 2

What this Moodle plugin is for

This Moodle plugin sends an email notification message to the 'Support email' address every time a new Moodle user account is created via the 'Email signup' authentication plugin. The notification message contains some essential details about the account just created (email address, full name and user account name).

The email is sent when the user signs up, not when the user account is confirmed. So the plugin will notify even about accounts that may never be confirmed.

Supported Moodle Versions

Versions of the plugin up to 1.0.2 works with Moodle 2.7 or later versions. Versions of the plugin from 2.0.0-gdpr-3.6+ onwards only work with Moodle 3.6 or later.

Installation

This is a standard Moodle Local Plugin, so you can follow the standard installation instructions for Moodle Plugins at https://docs.moodle.org/en/Installing_plugins . Note that if you install this plugin manually at the server, you need to install it inside the 'local' directory at the top of the moodle installation directory.

Configuration

The only configuration used by the plugin is the Support Contact settings. It uses the 'Support name' and 'Support email' settings as the recipient of the email notification messages it sends.

You can customise the content/wording of the notification messages by editing the language strings of the plugin, e.g., through the built-in 'Language customisation' mechanism. All the user table fields and custom profile fields are available in the $a object as {$a->signup_valuename}. The syntax of valuename depends on whether the value comes from the user table fields or from the custom profile fields (this is due to an unfortunate limitation of the Moodle language strings interpolation syntax).

  • For the user table fields, the syntax for valuename is user_fieldname, where fieldname is one of user table fields like id, username, auth, firstname, lastname, etc. The password field does not contain the actual password, for security reasons.
  • For the custom profile fields, the syntax for valuename is profile_profileshortname, where profileshortname is the shortname of the custom profile field.

The following examples may help understand the syntax. Assuming we have two custom profile fields, whose short names are signupcategory and referralcode, we could use the following values in the notification message language string (only some of the user table fields are shown for brevity purposes):

  • {$a->signup_user_id}: this will be substituted by the account id.
  • {$a->signup_user_username}: this will be substituted by the account username.
  • {$a->signup_user_lastname}: this will be substituted by the account lastname.
  • {$a->signup_user_city}: this will be substituted by the account city.
  • {$a->signup_profile_signupcategory}: this will be substituted by the content of the custom profile field whose shortname is signupcategory.
  • {$a->signup_profile_referralcode}: this will be substituted by the content of the custom profile field whose shortname is referralcode.

Screenshots

Screenshot #0

Contributors

Iñaki Arenaza (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Pahalavan R D
    Thu, 2 Jul 2020, 12:03 PM
    @Iñaki Arenaza,

    Thank you very much smile
  • Reggie Frias
    Tue, 1 Sep 2020, 3:51 PM
    is this plugin work even admin created the user manually?
    I need this kind of function
    can someone help me?
  • Iñaki Arenaza
    Wed, 2 Sep 2020, 1:21 AM
    Hi @Reggie Frias,

    I'm afraid it doesn work if the admin creates the user manually, unless the assigned authentication method (authentication plugin) is one that supports signups. Which doesn't include the manual authentication plugin. The only two standard authentication plugins that support signups are email and LDAP (other third party plugins might too).

    The previous version of the plugin only supported the email authentication plugin, but I have just updated a new version (that only works in Moodle 3.6 or later) that supports any installed plugin with signup support. It shows the list of such authentication plugins and lets the administrador configure which ones we want to enable this plugin for.

    But as I said, the plugin restricts that list to those authentication plugins that enable signup (which in my humble opinion is what makes sense). If you want to list every installed authentication plugin, whether they support signups or not, and enable any of them, you just need to comment out these lines in the plugin: https://github.com/iarenaza/moodle-local-notifyemailsignup/blob/master/settings.php#L43-L45.

    Saludos.

    Iñaki.
  • Hossein K
    Mon, 15 Feb 2021, 9:04 PM
    Hello
    Thank you so much for your plugin. It really helps.
    Also it is really amazing that it is not in the core of the Moodle !
    Regards
  • Abdelrahman Elwakeel
    Tue, 23 Mar 2021, 7:33 PM
    Hello Iñaki Arenaza,
    the plugin work fine for user sign up via self Regiration only But not via OAuth (sign up from social media; google and facebook and linkedin), any you idea?
    Regards
  • Iñaki Arenaza
    Tue, 23 Mar 2021, 11:00 PM
    Hi @Abdelrahman Elwakeel,

    which version of the plugin are you using? (you can paste here the contents of the version.php file inside the plugin directory)
  • Abdelrahman Elwakeel
    Tue, 23 Mar 2021, 11:07 PM
    Hi @Iñaki Arenaza
    the version of the plugin I used this
    $plugin->version = 2019061601;
    Regards
  • Iñaki Arenaza
    Sat, 27 Mar 2021, 9:49 PM
    Hi @Abdelrahman Elwakeel,

    as I said on 1 Sep 2020, the plugin doesn't work unless the assigned authentication method (authentication plugin) is one that supports signups. Which doesn't include the OAuth2 authentication plugin. The only two standard authentication plugins that support signups are email and LDAP (other third party plugins might too).

    If you want to list every installed authentication plugin, whether they support signups or not, and enable any of them, you just need to comment out these lines in the plugin: https://github.com/iarenaza/moodle-local-notifyemailsignup/blob/master/settings.php#L43-L45.

    Saludos.
    Iñaki.
  • H D
    Mon, 22 Aug 2022, 10:37 PM
    Will you comeup with updated version for Moodle 4?
  • Iñaki Arenaza
    Fri, 26 Aug 2022, 4:00 PM
    Hi @Arkin Institute,

    the current version works perfectly well in Moodle 4.0 (just tested it, and 3.9, 3.10 and 3.11 versions too.). So no need for a newer version at all smile

    I will update the plugin info to reflect this information.
  • H D
    Fri, 9 Sep 2022, 2:48 PM
    Any plan to add OAuth2 authentication in the list of authentication plugin to send notification email?
  • Iñaki Arenaza
    Mon, 12 Sep 2022, 5:55 PM
    Hi @Arkin Institute,

    there are no plans to add OAuth2 authentication to the list of authentication plugins to send notification email.

    As I said on 1 Sep 2020, the plugin doesn't work unless the assigned authentication method (authentication plugin) is one that supports signups (the standard Moodle internal mechanism for user signups). Which doesn't include the OAuth2 authentication plugin. The only two standard authentication plugins that support signups, as of today, are email and LDAP (and maybe other third party plugins might too).

    If you want to list every installed authentication plugin, whether they support standard signups or not, and enable any of them, you just need to comment out these lines in the plugin: https://github.com/iarenaza/moodle-local-notifyemailsignup/blob/master/settings.php#L43-L45.

    Saludos.
    Iñaki.
  • Gemma Lesterhuis
    Fri, 3 Feb 2023, 4:17 PM
    @Iñaki I just want to let you know I have tested the plugin in 4.1 and it worked without problems. I did not see any PHP errors.
  • Iñaki Arenaza
    Wed, 8 Feb 2023, 12:41 AM
    @Gemma Thanks a lot! Will update the plugin details to reflect it!
  • Lionel Martínez Segarra
    Tue, 5 Mar 2024, 8:25 AM
    Hola, Iñaki:
    Would it be possible to include in some way that the email would also be sent to the teachers of the course in which the enrollment occurs?
    TY for the plugin!
1 2
Please login to post comments