User to User Communication

I’d like to create a form allows site users send emails other site users. Any guidance?

I figured the button code would look something like this.

export​ function​ sendButton_click​(event, $w)
let​ from​ = $w(“#from”).value;
let​ to = $w(“#to”).value;
let​ subject = $w(“#subject”).value;
let​ message = $w(“#message”).value;

4 Likes

would be interesting to know if you did this?

Hello Daniel, did you find a solution for messaging?

Hi,
You can use the Sendgrid API. You can check out this article . However, note that you should have two Email fields- one for the site visitor who sends the Email and the other one for the site visitor who should receive the Email. Therefore, you need to modify the code a bit:

export function sendEmailWithRecipient(subject, body, sender ,recipient) { 
 const key = "QL.cFH5YHZQQ2_fG0z_KuQ.6WPTYEyjN1C3_7Wt9Hb3jGfkJNAyzJhz3ddhM";  
 return sendWithService(key, sender, recipient, subject, body); 
}
function sendFormData() {  
 const subject = `New Submission from ${$w("#nameInput").value}`; 
 const body = `Name: ${$w("#nameInput").value}     
 \rEmail: ${$w("#emailInput").value}    
  \rSport: ${$w("#sportDropdown").value}     
  \rComments: ${$w("#commentsInput").value}`;  
  const sender = $w('#emailFromInput).value;
  const recipient = $w("#emailToInput").value;    
  sendEmailWithRecipient(subject, body, sender, recipient)     
     .then(response => console.log(response));  
}

I hope it’s clear.

Good luck!
Tal.

Thanks Tal! Ill give it this a try as we wait for the official chat release. Katrin from Wix Chat just updated another post for User A to User B messaging stating that there will be a beta group testing this and it is available for others to join. See post below…