website/index.njk

36 lines
1.3 KiB
Plaintext

---
layout: base.njk
---
<h1>email.radio</h1>
<p>email.radio is dedicated to providing free email hosting for all licensed ham radio operators. You will get a (free!) email @email.radio address.</p>
<p>If you already have an account, you can access the <a href="https://mail.email.radio" target="_blank">dashboard here</a> and the <a href="https://mail.email.radio/SOGo" target="_blank">webmail here</a>.</p>
<input placeholder="Callsign" id="call" oninput="updateEmail()">
<br>
<input placeholder="Your regular email" id="email">
<p id="emailf">Your email will be</p>
<button id="btn" onclick="submit()">Submit!</button>
<script>
function updateEmail(){
document.querySelector("#emailf").innerHTML = `Your email will be ${document.querySelector("#call").value}@email.radio!`
}
function submit(){
document.querySelector("#btn").disabled = true
var call = document.querySelector("#call").value
var email = document.querySelector("#email").value
fetch(`https://signup.email.radio/signup?email=${email}&callsign=${call}`)
.then(res=>res.json())
.then(res=>{
if (!res.success){
document.querySelector("#btn").disabled = false
alert(res.error)
} else {
alert("Please check your email for more information. Your callsign will be validated before your mailbox is created. This may take up to 48 hours.")
}
})
}
</script>