From 4.12 onwards custom alerts can be defined for both system and user. This alerts will be created using scripting.
It can be done in any kind of script just adding a few lines as the next examples show:
System alert
import org.cyclos.impl.messaging.AlertServiceLocal import org.cyclos.model.messaging.alerts.SystemAlertType AlertServiceLocal alertService = binding.alertService alertService.create(SystemAlertType.CUSTOM, /*Alert text*/ "This is a system alert example")
User alert
import org.cyclos.impl.messaging.AlertServiceLocal import org.cyclos.model.messaging.alerts.UserAlertType AlertServiceLocal alertService = binding.alertService; // Create the alert for the corresponding user, in this case we use the one logged. alertService.create(sessionData.getLoggedUser(), UserAlertType.CUSTOM, /*Alert text*/ "This is a user alert example")
This type will appear as a new option in the administrators notification settings page under "User alerts" and "System alerts" preferences.