How to Open Contact Button Links in New Tab? | Contact a Human | Agent Skill

Howdy,

Just noticed… when our visitors click the “email” contact button to reach a human, the email client opens in the same page as the website (i.e., chatbox). How can we get those contact buttons (all of them) to open in a new tab when a visitor clicks on them? See below. At your next widget update, it would be nice to add a setting to the “Contact a Human” agent skill so we can choose between opening the contact links in the same page or a new tab.

Thank you!


Hi there, @Petar_Dietrich :waving_hand:

I’ve tested the widget on mobile and it opens separate apps for SMS and Email services. As for the desktop, SMS button requires Pick an app and Email button opens the Email service in a separate window.

Could you please share a screencast of how it’s working on your end?

Hey @Max,

After further testing, I can confirm the SMS button opens the affected app in a new tab/window. I can also confim that when I click on the Email button, the default email client opens on the same page/tab. Email client tested: Gmail. Environment: Desktop, Windows 11.

Screencast: Omnia Aerospace | Global Aviation Consulting Company - 23 April 2026 | Loom

Perhaps you can benchmark others to see if they are experiencing the same.

Cheers!

Got it, thanks!

I’ve passed in to the devs and will update you once the solution is ready :slightly_smiling_face:

Hi there, @Petar_Dietrich :waving_hand:

Thank you for wating!

This script should do the trick:

const EMAIL = "support@omniaaerospace.com";

document.addEventListener('click', (event) => {
  const contactButton = event.target.closest(
    `.eapps-ai-chatbot-${WIDGET_ID}-custom-css-root .es-content-button-button`
  );

  if (!contactButton || contactButton.textContent !== '\n\nEmail') {
    return;
  }

  event.preventDefault();
  event.stopPropagation();
  
  window.open(`mailto:${EMAIL}`, '_blank');
}, true);

Please add it to the Custom JS field and let me know if it helped :slightly_smiling_face:

Hey @Max,

Your code worked, but only after adding a semi-colon after the email address. Like this:

const EMAIL = "support@omniaaerospace.com";

Thank you!

Ah, apologies for missing the semicolon!

I am glad to hear this solution worked for you, thanks for the feedback. If any other questions come up, we’ll be happy to advise :slightly_smiling_face: