Skip to main content

Mailgo direct render

From mailgo 0.10.* the modal (mail or tel) can be shown also without an <a> element, but just with a mailto: or tel: / callto: / sms: URI as a parameter in a new function called mailgoDirectRender.


Here the definition of the function in TypeScript:

function mailgoDirectRender(directUrl: string): boolean;

this function fires the render of mailgo modal with the link passed as a parameter.

You can use it, for example, in this way.

import mailgo, { mailgoDirectRender } from "mailgo";

document.getElementById("direct-button").addEventListener("click", function () {

This code fires the mailgo modal on click on a button with id='direct-button'.

You can see more examples of this new features in the examples folder of the mailgo repository or on (the repository of Mailgo examples is here:

Real example

<button onclick="mailgoDirectRender('')">
Open a mailgo directly (mail)