var div = document.getElementById('AttApp'); div.innerHTML += '

By submitting this form, you agree to receive recurring automated promotional and personalized marketing text messages (e.g. cart reminders) from INH Hair at the cell number used when signing up. Consent is not a condition of any purchase. Reply HELP for help and STOP to cancel. Msg frequency varies. Msg & data rates may apply. View Terms & Privacy.

'; document.getElementById('attentive_form').addEventListener('submit', function(event){ event.preventDefault(); var phone = document.getElementById("phone__input").value; var attentiveVisitorId = document.cookie.replace(/(?:(?:^|.*;s*)__attentive_ids*=s*([^;]*).*$)|^.*$/, "$1"); var headers = { 'Authorization': 'Bearer JUZyivxoiKn82RMuAoxqJTCeUISydfzjRKLdIes_Sos', 'Content-Type': 'application/json' }; fetch('https://api.attentivemobile.com/1/add-subscribers', { method: 'POST', headers: headers, body: JSON.stringify({"phone": phone , "visitorId": attentiveVisitorId }), }) .then(response => response.json()) .then(data => { console.log('Success:', data); document.getElementById('attentive_form').style.display = "none"; var success = document.getElementById('SuccessMsg'); success.innerHTML += '

Thanks for Subscribing!

' }) .catch((error) => { console.error('Error:', error); }) });