Skip to content

Latest commit

 

History

History
74 lines (64 loc) · 2.55 KB

mailList.md

File metadata and controls

74 lines (64 loc) · 2.55 KB
layout title
default
Mailing List -

Beta

×
Hey There! Welcome to our new mailing list page! We've recently made big changes to server side stuff, apologies for any errors

Mailing List
Please enter your email below to be notified of new articles!


Email address
Success! You should receive the next blog notification in your inbox :)
Something went wrong, have you entered a valid email?
We'll never share your email with anyone else.
Submit
<script> var flag = false; function saveToFirebase(email) { let mails = firebase.database(); if(flag){ alert('you have already entered a valid email address'); error(); return; } email = email.trim() if (!email.includes('@') || !email.includes('.') || email.includes(' ')){ error(); return; } var emailObject = { email: email }; mails.ref('subscription-entries').push().set(emailObject) .then(function(snapshot) { success(); // some success method }, function(error) { console.log('error' + error); error(); // some error method }); } function error(){ document.getElementById('inputEmail').classList.remove("is-valid"); document.getElementById('inputEmail').classList.add("is-invalid"); return; } function success(){ document.getElementById('inputEmail').classList.remove("is-invalid"); document.getElementById('inputEmail').classList.add("is-valid"); flag = true; return; } </script>