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 6, 2024
1 parent f2446b0 commit cad8cb3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions js/rt-html-abs.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,15 @@ function sendEmail() {
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;

if (navigator && navigator.app && navigator.app.loadUrl) {
// Android
navigator.app.loadUrl(mailtoUrl, { openExternal: true });
} else {
// iOS and others
window.open(mailtoUrl, '_system');
}
}

// Contact Operations
async function copyContactInfo(type) {
const content = type === 'phone' ? '{phone}' : '{email}';
Expand Down

0 comments on commit cad8cb3

Please sign in to comment.