# URGENT- mailto: button in repeater has stopped working

**URL:** <https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [July 7, 2021, 1:07pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365 "2021-07-07T13:07:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![1425club66601](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/1425club66601/32/15473_2.png) [@1425club66601](https://forum.wixstudio.com/u/1425club66601)\
**Post date:** [July 7, 2021, 1:07pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365/1 "2021-07-07T13:07:43Z")

</div>

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” ;

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [July 7, 2021, 2:32pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365/2 "2021-07-07T14:32:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![smwebview](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/smwebview/32/6158_2.png) [@smwebview](https://forum.wixstudio.com/u/smwebview)\
**Post date:** [July 7, 2021, 4:15pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365/3 "2021-07-07T16:15:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [July 7, 2021, 7:01pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365/4 "2021-07-07T19:01:37Z")

</div>

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() .

---

<div class="post-metadata">

**Author:** ![1425club66601](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/1425club66601/32/15473_2.png) [@1425club66601](https://forum.wixstudio.com/u/1425club66601)\
**Post date:** [July 7, 2021, 7:14pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365/5 "2021-07-07T19:14:22Z")

</div>

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](mailto: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](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](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](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](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` );  
}

---

<div class="post-metadata">

**Author:** ![1425club66601](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/1425club66601/32/15473_2.png) [@1425club66601](https://forum.wixstudio.com/u/1425club66601)\
**Post date:** [July 7, 2021, 7:17pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365/6 "2021-07-07T19:17:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![1425club66601](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/1425club66601/32/15473_2.png) [@1425club66601](https://forum.wixstudio.com/u/1425club66601)\
**Post date:** [July 7, 2021, 7:48pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365/7 "2021-07-07T19:48:09Z")

</div>

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.

 ![](https://us1.discourse-cdn.com/wix/original/3X/6/4/641f321a7c7bb186270c474221313217249973aa.jpeg)

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [July 7, 2021, 8:02pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365/8 "2021-07-07T20:02:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![1425club66601](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/1425club66601/32/15473_2.png) [@1425club66601](https://forum.wixstudio.com/u/1425club66601)\
**Post date:** [July 7, 2021, 10:46pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365/9 "2021-07-07T22:46:47Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![1425club66601](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/1425club66601/32/15473_2.png) [@1425club66601](https://forum.wixstudio.com/u/1425club66601)\
**Post date:** [July 8, 2021, 1:32pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365/10 "2021-07-08T13:32:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [July 8, 2021, 5:50pm UTC](https://forum.wixstudio.com/t/urgent-mailto-button-in-repeater-has-stopped-working/38365/11 "2021-07-08T17:50:48Z")

</div>

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