NAV Navbar
javascript

.setUserEmail()

var email = 'johnsnow@thenorth.com';

// Set the email field
SnapEngage.setUserEmail(email);

// Do the same as above AND make the email field read-only
// i.e. not editable for the visitor
SnapEngage.setUserEmail(email, true);

Provide a visitor's email address to SnapEngage.

This will do two things: First, it pre-populates the 'email' field on your prechat or offline form.

Second, even if you are not using a prechat form, this will still provide a visitor’s email address to an agent who takes the chat. (The email gets stored in the case and will be passed to your integration at the close of the case).

Parameters

Parameter Type Description
email String A non-encoded email address, for example, 'someone@example.com'. You will need to use your local environment to deliver the email address to this function, either through server-side scripting or JavaScript.
locked boolean An optional parameter. If set to true, the email field will be locked i.e. read-only and the visitor will not be able to edit the field. If set to false, the email field will not be read-only and the visitor will be able to edit the field (this is the default).