'); myWindow.document.close(); myWindow.focus(); setTimeout(function() { myWindow.print(); myWindow.close(); }, 500); }; // 2. EMAIL FUNCTION window.emailPracticePlan = function(btn) { var contentDiv = document.getElementById('practice-plan-content'); if (!contentDiv) { alert("Error: No plan found to copy."); return; } var originalHtml = btn.innerHTML; var planText = contentDiv.innerText; // Get plain text for clipboard navigator.clipboard.writeText(planText).then(function() { // Visual Feedback btn.innerHTML = ' COPIED!'; btn.style.borderColor = "#28a745"; // Open Email setTimeout(function() { var subject = "Practice Plan - " + new Date().toLocaleDateString(); window.location.href = "mailto:?subject=" + subject; }, 500); // Reset Button setTimeout(function() { btn.innerHTML = originalHtml; btn.style.borderColor = "#000000"; }, 3000); }).catch(function(err) { alert('Manual Copy Required. Please select text and copy.'); }); };

[lightning_home]