add verification email resend

This commit is contained in:
Niko Storni 2020-03-04 19:06:33 +01:00
parent 82b50f7dfd
commit 5b5f0adb43
2 changed files with 21 additions and 1 deletions

View file

@ -143,7 +143,7 @@
You need to provide an email
</p>
<p <?php echo ($statusData['has_verified_email']===false && $statusData['email']!=="") ? "" : "hidden"?> class="error-block">
You need to verify your email
You need to verify your email! <a href="#" onClick="return resendVerificationEmail()">Click here to resend a verification email</a>
</p>
<fieldset-group>

View file

@ -38,6 +38,26 @@ function submitEditForm() {
});
}
function resendVerificationEmail(token, email) {
let data = new FormData();
data.append("status_token", $.trim($('#status_token').val()));
data.append("email", $.trim($('#email').val()));
let xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://localhost:8080/yt/resend_verification_email");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("Accept", "*/*");
xhr.send(data);
}
function submitDetailsForm() {
$("#youtube_claim").submit(function (event) {