Hi there.
I'm using this code on a button in a repeater list:
}); import wixLocation from 'wix-location'; export function button1_click(event) {wixLocation.to("mailto:name@domain.ch?subject=Kontakt von Website"); //Add your code for this event here: }
Is it possible to replace the name@domain.ch with a database field where the e-mails adresses are as writen as text?
Thanks a lot. Cheers, Patrizia
Hello Patrizia
Yes, you can do that by queering the database for that field. then the result will be an array of all items in that field, so after that you can set the link to any value of this array:
wixData.query("myCollection") .eq("Field", value) .find() .then( (results) => { let items = results.items; // here you can add your code to link to the items value. } ) .catch( (error) => { let errorMsg = error.message; let code = error.code; } );
Best
Massa