function resendVerificationEmail(event) {
    // CALL RESEND VERIFICATION EMAIL SCRIPT
    // GRAB CURRENT CPM AND UPDATE FIELDS
    var data = "zic="+encodeURIComponent(event.target.value);
    var ajax = new XMLHttpRequest();
    var response;
    ajax.open("POST","/core/ajax/resend_verification_email.php",true);
    ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    ajax.send(data);
    ajax.onreadystatechange = function() {
        if(this.readyState === 4 && this.status === 200) {
            // GET RESPONSE
            response = this.responseText;
            console.log(event.target);
            event.target.removeAttribute("value");
            event.target.classList.remove("CP");
            event.target.innerHTML = response;
            event.target.removeEventListener("click",resendVerificationEmail);
        }
    };
}

var resend_link = document.getElementById('resend_email_verification');
if(Boolean(resend_link)) { 
    resend_link.addEventListener('click', resendVerificationEmail);
}