Admin tools: Event Trigger

tool_trigger
Maintained by Picture of Catalyst IT Catalyst IT, Catalyst logo Aaron Wells, Picture of Matt Porritt Matt Porritt, Picture of Dan Marsden Dan Marsden
This plugin plugin allows site administrators to trigger external actions such as an http request or email when certain events happen in Moodle. Filters can be added to check if the event meets certain conditions and actions(email/http post) can include information contained within the Moodle event. Lookups can also be added to the workflow to allow information not contained within the Moodle event to be exposed to the external action.
25 sites
121 downloads

Event Trigger

The Event Trigger allows Moodle Events to be monitored and a workflow to be triggered when that event occurs.
One of the main use cases of this plugin is to allow Moodle events to trigger actions in external systems.

Each workflow is made up of a series of steps. Steps can be things like:

  • Using event data to lookup user and course information
  • Filtering data based on a set of conditions
  • Performing an action like sending an email or Posting data to a HTTP endpoint or external API.

More configuration documentation can be found at the following link:

More Information on Moodle events can be found in the Moodle documentation at the following link:


Supported Moodle Versions

This plugin currently supports Moodle:

  • 3.3 (PHP 7 is required)
  • 3.4
  • 3.5

Moodle Plugin Installation

The following sections outline how to install the Moodle plugin.

Command Line Installation

To install the plugin in Moodle via the command line: (assumes a Linux based system)

  1. Get the code from GitHub or the Moodle Plugin Directory.
  2. Copy or clone code into: <moodledir>/admin/tool/trigger
  3. Run the upgrade: sudo -u www-data php admin/cli/upgrade Note: the user may be different to www-data on your system.

User Interface Installation

To install the plugin in Moodle via the Moodle User Interface:

  1. Log into your Moodle as an Administrator.
  2. Navigate to: Site administration > Plugins > Install Plugins
  3. Install plugin from Moodle Plugin directory or via zip upload.

Plugin Setup

Plugin setup and configuration documentation can be found at the following link:


Crafted by Catalyst IT

This plugin was developed by Catalyst IT:

https://www.catalyst-au.net/

Catalyst IT

Contributing and Support

Issues, and pull requests using github are welcome and encouraged!

https://github.com/catalyst/moodle-tool_trigger/issues

If you would like commercial support or would like to sponsor additional improvements to this plugin please contact us:

https://www.catalyst-au.net/contact-us


Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3

Contributors

Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Plugins bot
    Wed, 16 May 2018, 8:00 AM
    Approval issue created: CONTRIB-7306
  • Picture of Brandon Jimenez
    Thu, 2 Aug 2018, 4:33 AM
    Hello guys: This plugin looks really good to customise the platform without going too deep into the code. That being said, i've been trying to configure a simple workflow to send an email when the user updates their password, and probably something is off. I've configured the event to be monitored as Core: user password updated and then two steps: a lookup by user ID, and then an action to send an email with that info.... is there any kind of examples on your wiki? i couldn't find any.
    Best Regards
  • Picture of Dan Marsden
    Thu, 2 Aug 2018, 4:35 AM
    @Brandon - is cron running on your server?
  • Picture of Brandon Jimenez
    Thu, 2 Aug 2018, 9:29 PM
    Hello Dan, yes it is, and i checked here...Site administration > Server > Scheduled tasks, and it show both events as being active, and configured to run as per the defaults from your original settings. The two events shows as active, running and have been triggered, but on Workflow overview, under "Last triggered", nothing shows.....

    Anyway, best regards
  • Picture of Dan Marsden
    Fri, 3 Aug 2018, 5:32 AM
    Better documentation is on the task-list, but not quite there yet - to debug this further you could try enabling the standard core event monitoring plugin and add a subscription to the update password event and see if you get an e-mail via that method - if you don't get the e-mail via that method either it's likely not an issue with the trigger plugin but an issue with your site. If you do get the e-mail via the core event monitoring tool then it points to an issue with the configuration of your trigger (or a bug with the trigger code.)
  • Picture of Brandon Jimenez
    Fri, 3 Aug 2018, 9:14 PM
    Hello Dan:
    I enabled the event monitoring and got no response. I checked and the system is well configured to send emails (is sending them when the user is created and when enrolment status changes) so that rules out the server not being able to send emails. You're probably in that is not the trigger plugin, Is there a way to attach any sort of screenshots?

    as usual, appreciate the help and best regards
    Brandon
  • Picture of Dan Marsden
    Mon, 6 Aug 2018, 7:18 AM
    yeah - either your server is not sending emails, or the event you are subscribed to is not being triggered - I'd suggest asking for help in the forums - once you get the core event monitoring plugin to work you could try again with our trigger plugin - good luck!
  • nbirt
    Wed, 8 Aug 2018, 10:05 AM
    Hello, this looks like it could be much more useful than event monitoring. Does it require PHP 7? We are currently running PHP 5.6.36 and are not able to get it to function as of yet. We get Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /var/www/oursite.org/htdocs/admin/tool/trigger/classes/output/manageworkflows/renderable.php on line 133.
  • nbirt
    Wed, 8 Aug 2018, 10:07 AM
    It's Moodle 3.3.6 btw...
  • Picture of Dan Marsden
    Wed, 8 Aug 2018, 10:49 AM
    yeah - we've only been testing this with PHP 7 sorry - Moodle 3.3 support might be limited.
  • Picture of Brandon Jimenez
    Thu, 9 Aug 2018, 11:53 PM
    hello Dan: Finally i manage to make the core event to work and send me a simple email when a user changes their password. Then i went back for yours... and it's a shame i can't add some screenshots here. So now i know that the emails server is working and that the event itself is being observed by someone (maybe the NSA as well). However, i still can't make your plugin to work, and i'm running out of ideas. Will keep checking your wiki to see if i missed something.

    Best regards
  • Picture of Brandon Jimenez
    Fri, 10 Aug 2018, 12:40 AM
    Update: i recreated my original workflow and added another one to trigger when a user logs in and both are showing a date under "Last triggered" which is good news. In both i created a Lookup and then an Action but it keeps not sending the email. BTW, the Datafield image that i can see on your wiki i can't see it anywhere, as well as i can't activate the learning mode. is that from a newer version? Mine is 2018051002
  • Picture of Dan Marsden
    Fri, 10 Aug 2018, 5:04 AM
    yeah - that's the version in the plugins db here, but the code has moved on a lot since then - latest code is all in github - probably worth giving the code from github a go to see if that works better for you.
  • Picture of Brandon Jimenez
    Fri, 10 Aug 2018, 11:25 PM
    Hello Dan: I updated to the latest version you have on github and habe news: now the workflow i created to track the user logging in is working, but the one for the password change isn't. I know it's being triggered (the event) as both the Last triggered column in your plugin and the core event changes (i'm receiving an email from the core in that event). I also have basically the same actions in both, using mostly the same info. Is there something else i could look up for? Also, it's a little bit bizarre that when we update the workflow, the last triggered column goes blank (i understand the logic, but it would be worth mentioning it in the wiki). As usual, best regards.
  • Picture of Dan Marsden
    Mon, 13 Aug 2018, 5:40 AM
    Sounds weird - thanks for the update, let us know if you figure it out! - thanks.
Please login to post comments