The customer may install an email capture field on their website that connects directly to their email database in our system. So when someone enters their email address on the customer's website, it appears in the Contacts tab in the backend system.
So how do you do it? Simply have the customer install the following code on their website. They will need their account number in Social5 to complete the installation. Once installed, there is no need for any action in the Social5 system for the integration to work . . .
Install the following code:
function s5Subscribe() {
var status = document.getElementById("s5-subscribe-status");
var method = "GET";
//Email only
//var emailField = document.getElementById("s5-subscribe-email");
//var url = "//socialfive.net/email/subscribe.html?p=" + s5AccountId + "&e=" + encodeURIComponent(emailField.value);
//Name, phone, and email
var nameField = document.getElementById("s5-subscribe-name");
var phoneField = document.getElementById("s5-subscribe-phone");
var emailField = document.getElementById("s5-subscribe-email");
var note;
switch(document.location.pathname) {
case "/": note = "Submitted via homepage"; break;
case "/apply-now/": note = "Submitted via 'Apply Now' page"; break;
default: note = "";
}
var url = "//socialfive.net/email/subscribe.html?p=" + s5AccountId + "&n=" + encodeURIComponent(nameField.value) + "&ph=" + encodeURIComponent(phoneField.value) + "&e=" + encodeURIComponent(emailField.value) + "¬e=" + encodeURIComponent(note);
var xhr = s5CreateCORSRequest(method, url);
xhr.onload = function() {
if(xhr.response.indexOf("OK") == 0) {
status.innerHTML = "Thank you for joining our mailing list!";
nameField.value = "";
phoneField.value = "";
emailField.value = "";
sendmail_ajax();
}
else
status.innerHTML = xhr.response;
status.style.display = "block";
};
xhr.onerror = function() {
status.innerHTML = xhr.response;
status.style.display = "block";
};
xhr.send();
return false;
}