You cannot use mailto links with Velo buttons.
If your website is connected to your own domain, you can add a custom element to your page and make it collapsed and use it):
//page code
$w.onReady(() => {
$w('buttonEnvoie').onClick(() => {
const info = {
subject: 'Compte rendu',
body: $w('#text77').text,
emailAddress: $w('#textMailCandidat').text,
timestamp: Date.now()
};
//I added the timestamp, so every click will trigger the element with a different the value, even if it's the same email, subject and body.
$w('#customElement').setAttribute('email-details', JSON.stringify(info));
});
})
//custom element file
class EmailTo extends HTMLElement {
static get observedAttributes() { return ['email-details']; }
attributeChangedCallback(name, _ ,newValue) {
if (name === 'email-details') {
const info = JSON.parse(newValue);
window.open(`mailto:${emailAddress}?subject=${encodeURI(info.subject)}&body=${encodeURI(info.body)}`, '_self');
}
}
}
customElements.define('email-openner', EmailTo);//use 'email-openner' when you define the custom element on the eidtor UI.