Verified teachers can message a student directly through Ustaad Online. Students\' phone numbers and emails are never shown here.
' + 'Loading students...
' + '' + 'No students match your filters yet.
'; return; } els.grid.innerHTML = list.map(function (s) { return 'Only registered teachers can message students. Enter the email you used to register and we will send you a 6-digit code.
' + 'If ' + esc(loginEmail) + ' belongs to an approved teacher, a 6-digit code was just sent. It expires in 10 minutes. Please check your spam folder too.
' + 'Sending as ' + esc(teacherName || "teacher") + ' ยท Not you?
' + 'The student receives this message by email from Ustaad Online, together with your name, phone and email so they can reply. The student\'s own contact details are not shown to you.
' + '' + ''; var text = $("usgText"), btn = $("usgSend"); text.addEventListener("input", function () { $("usgLen").textContent = text.value.length; setStatus(""); }); $("usgSwitch").addEventListener("click", function (e) { e.preventDefault(); logout(); stepEmail(); }); btn.addEventListener("click", function () { var msg = text.value.trim(); if (msg.length < 10) { setStatus("Please write at least 10 characters.", true); return; } busy(btn, true, "Sending..."); api("/student-message", { method: "POST", token: token, body: { student_id: target.id, message: msg } }) .then(stepDone) .catch(function (e) { if (e.status === 401) { logout(); stepEmail("Your session expired. Please verify again."); return; } busy(btn, false, "Send message"); setStatus(e.message, true); }); }); text.focus(); } function stepDone() { els.title.textContent = "Message sent"; els.body.innerHTML = 'Your message was emailed to ' + esc(target.name) + ". They can reply to you directly.
" + '