@marganellim the script I gave you is for the "script" section of the email event handler. That is the only place the "model" is included in the script context as it is normally used to modify the model that is used to generate the Email via the FTL template but you can do anything you want in that script.
The script you use will depend on the type of Event Handler you choose. If you want to use a "Script" Event Handler then this would work:
/** * This script implements com.serotonin.m2m2.rt.event.handlers.EventHandlerInterface * Add this script to a "Script" type event handler and choose the Graal.js or Nashorn engine. */ /** * Called when the Mango event is raised. * You must implement this method. * * @param event */ function eventRaised(event) { console.log('Raised', event); console.log('test xid: ' + event.getContext().get('point').getXid()); } /** * Called when the Mango event is acknowledged (the event may still be active). * Supported as of Mango v4.0.0-beta.14, you are not required to implement this method. * * @param event */ function eventAcknowledged(event) { console.log('Acknowledged', event); } /** * Called when the Mango event returns to normal or is deactivated (e.g. on shutdown). * You must implement this method. * * @param event */ function eventInactive(event) { console.log('Inactive', event); }