URGENT- mailto: button in repeater has stopped working

URGENT- I created a button in a repeater which is linked to a database using the mailto: code. It was working I tested it, then all of a sudden it has stopped.

Can anyone please tell me what is going on?

Thanking you in advance.
Sylvia

import wixData from ‘wix-data’ ;
import wixUsers from ‘wix-users’ ;
//let m1Email ;

wixData . query ( “1425MemberProfiles” )
. find ()
. then (( results ) => {
$w ( “#repeater1” ). onItemReady (( $item , itemData , index ) => {
let m1Email = itemData . email ;
let m1EmailPrefix = “mailto:” ;
//no let m1EmailAddress = (m1EmailPrefix + m1Email);
//let m1EmailAddress = m1EmailPrefix + m1Email;
// let m1EmailAddress = “mailto:” + m1Email;
let m1EmailAddress = ( “mailto:” + m1Email );

$item ( “#m1EmailAddress” ). link = m1EmailAddress ;
$item ( “#m1EmailAddress” ). target = “_blank” ;

Check the console for errors.
Make sure all the items have the email value.

No errors in the wix editor console. In the live site when you click a new window opens, but it’s blank. At the bottom of the screen I see ”mailto:“ and the users email address.

Are you sure this item has an email in the database?
If you hover over the button and + mouse right click, does it let you to copy the button URL (if it does, what’s the URL)?

  • there’s a problem with your code (but that’s probably not the issue) - you shouldn’t use $w(“#repeater1”) outside $ w.onReady() .

Hi JD thank you for helping!!!

  1. Yes the email is in the database. They have to have an email.

  2. Yes it let’s me copy the url it’s “mailto:name@gmail.com”

  3. This is the copied url is “name@gmail.com

Here is the complete code in case you see something else that is an issue.

import wixData from ‘wix-data’ ;
import wixUsers from ‘wix-users’ ;
import wixSearch from ‘wix-search’ ;
import wixLocation from ‘wix-location’ ;

let user = wixUsers . currentUser ;
let userId = user . id ;
let isLoggedIn = user . loggedIn ; // true
let m1Email

$w . onReady (() => {
$w ( “#text380” ). text = “Member to Member” ;
$w ( “#text381” ). text = “Members List” ;

getLoggedInMemberInfo ();
$w ( ‘#searchBarInput’ ). onInput (() => dataSearch ());

wixData . query ( “1425MemberProfiles” )
. find ()
. then (( results ) => {
$w ( “#repeater1” ). onItemReady (( $item , itemData , index ) => {
let m1Email = itemData . email ;
let m1EmailPrefix = “mailto:” ;
//no let m1EmailAddress = (m1EmailPrefix + m1Email);
//no let m1EmailAddress = m1EmailPrefix + m1Email;
// no let m1EmailAddress = “mailto:” + m1Email;
let m1EmailAddress = ( “mailto:” + m1Email );
let m1Name = itemData . m1Name1 ;
let m1Image = itemData . image ;
let m2Name = itemData . m2Name ;
let m2Image = itemData . m2Image ;
console . log ( "1 m1EmailAddress = " + m1EmailAddress )

$item ( “#m2Box” ). hide ();
$item ( “#m2Box” ). collapse ();
//link needs to come first
$item ( “#m1EmailAddress” ). link = m1EmailAddress ;
$item ( “#m1EmailAddress” ). target = “_blank” ;
$item ( “#readOnlyEmail” ). text = m1Email ;
$item ( “#m1Name” ). text = m1Name ;
//m1

if ( m1Image ) {
$item ( “#m1Image” ). src = m1Image ;
} else {
$item ( “#m1Image” ). src = “https://static.wixstatic.com/media/5da86a_557095a5d1a64d6cb7161170027488c0~mv2.jpg” ;
}

//m2
if ( m2Name ) {
$item ( “#m2Name” ). text = m2Name ;
$item ( “#m2Box” ). show ();
$item ( “#m2Box” ). expand ();
}
if ( m2Image ) {
$item ( “#m2Image” ). src = m2Image ;
} else {
$item ( “#m2Image” ). src = “https://static.wixstatic.com/media/5da86a_557095a5d1a64d6cb7161170027488c0~mv2.jpg” ;
}
});
});
});

function getLoggedInMemberInfo () {
wixData . query ( “Members/PrivateMembersData” )
. eq ( “_id” , userId )
. find ()
. then (( results ) => {
let loggedInMember = results . items [ 0 ];
})
}

function dataSearch () {
let searchValue = $w ( ‘#searchBarInput’ ). value ;
if ( searchValue . length > 0 ) {
$w ( ‘#1425MemberProfiles’ ). setFilter (
wixData . filter (). contains ( ‘email’ , searchValue )
. or ( wixData . filter (). contains ( ‘m1Name1’ , searchValue ))
. or ( wixData . filter (). contains ( ‘m2Name’ , searchValue ))

)
. then (( results ) => {
$w ( “#repeater1” ). onItemReady (( $item , itemData , index ) => {
let m1Email = itemData . email ;
// let m1EmailPrefix = “mailto:”;
//let m1EmailAddress = (m1EmailPrefix + m1Email);
let m1Name = itemData . m1Name1 ;
let m1Image = itemData . image ;
let m2Name = itemData . m2Name ;
let m2Image = itemData . m2Image ;

$item ( “#m2Box” ). hide ();
$item ( “#m2Box” ). collapse ();

$item ( “#m1Name” ). text = m1Name ;

//m1
if ( m1Image ) {
$item ( “#m1Image” ). src = m1Image ;
} else {
$item ( “#m1Image” ). src = “https://static.wixstatic.com/media/5da86a_557095a5d1a64d6cb7161170027488c0~mv2.jpg” ;
}
//m2
if ( m2Name ) {
$item ( “#m2Name” ). text = m2Name ;
$item ( “#m2Box” ). show ();
$item ( “#m2Box” ). expand ();
}
if ( m2Image ) {
$item ( “#m2Image” ). src = m2Image ;
} else {
$item ( “#m2Image” ). src = “https://static.wixstatic.com/media/5da86a_557095a5d1a64d6cb7161170027488c0~mv2.jpg” ;
}
});
});
}
}

export function resetButton_click ( event ) {
$w ( ‘#searchBarInput’ ). value = “” ;
$w ( ‘#1425MemberProfiles’ ). setFilter (
wixData . filter (). contains ( ‘email’ , " " )
. or ( wixData . filter (). contains ( ‘m1Name1’ , " " ))
. or ( wixData . filter (). contains ( ‘m2Name’ , " " ))
)
}

export function accountButton_click ( event ) {
wixLocation . to ( /account/account );
}

I had another dynamic page get messed up when I put more than one link on the page. I had to convert it to a regular page and then it worked. I wonder if having both the link to the detailed profile and a link to the email is the problem. Sounds crazy right?

I just created a non-dynamic version of the page and I get the same results. a new window opens with nothing on the screen.

@1425club66601 Can you please post the live site page URL. I’ll try to take a look (if it doesn’t require registration).

@jonatandor35 I would love that JD but unfortunately I have members info there and I’ve promised to keep it private. I did paste my page code above correct?

@jonatandor35 I did just notice when I mouseover on the Crome tab of the empty window it says “Loading mailto:the personsname@gmail.com”???

@1425club66601 I can’t tell w/o looking at the page. Try to see if it happens on other browsers/computers.