function onNotify(subject, receivers, template, params) {

    log.info("===== onNotify GLOBAL ===== Template: " + template);

    var validos = new java.util.ArrayList();

    for (var i = 0; i < receivers.size(); i++) {

        var email = receivers.get(i);

        log.info("Receiver original: [" + email + "]");

        if (email && email.indexOf("@") > 0 && email.indexOf(".") > 0) {
            validos.add(email);
        } else {
            log.warn("REMOVIDO EMAIL INVALIDO: [" + email + "] TEMPLATE: " + template);
        }
    }

    receivers.clear();

    for (var j = 0; j < validos.size(); j++) {
        receivers.add(validos.get(j));
    }

    log.info("TOTAL FINAL RECEIVERS: " + receivers.size());
}