Skip to content

Commit

Permalink
Update rt-html-abs.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ledangtrung committed Dec 5, 2024
1 parent f81336c commit ebed852
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/rt-html-abs.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ function callSIM() {
}
}

function sendEmail() {
const recipient = document.querySelector('[aria-labelledby="to-label"]').textContent;
const subject = document.querySelector('[aria-labelledby="subject-label"]').textContent;
const body = document.getElementById('message').value;
const mailtoUrl = `mailto:${recipient}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
window.location.href = mailtoUrl;
}

// Add event listeners for better keyboard accessibility
document.addEventListener('DOMContentLoaded', () => {
const buttons = document.querySelectorAll('.btn');
Expand Down

0 comments on commit ebed852

Please sign in to comment.