Avaliza

Potencialize a sua imobiliária com a Avaliza:

document.addEventListener('DOMContentLoaded', function() { var form = document.querySelector('form'); if (!form) return; form.addEventListener('submit', function(e) { e.preventDefault(); var name = document.getElementById('name') ? document.getElementById('name').value : ''; var email = document.getElementById('email') ? document.getElementById('email').value : ''; var phone = document.getElementById('phone') ? document.getElementById('phone').value : ''; if (!name || !email || !phone) { alert('Preencha todos os campos obrigatórios.'); return; } var data = { rules: { update: true, status: 'open', equal_pipeline: true, filter_status_update: 'open' }, leads: [{ id: email, title: 'Lead - ' + name, company: '', name: name, email: email, phone: phone, notes: [] }] }; var xhr = new XMLHttpRequest(); xhr.open('POST', 'https://app.pipe.run/webservice/integradorJson?hash=1543776a-0039-45fc-a864-eb0164cdbbfd', true); xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8'); xhr.onreadystatechange = function() { if (xhr.readyState === 4) { if (xhr.status === 200) { alert('Mensagem enviada com sucesso!'); form.reset(); } else { alert('Erro ao enviar a mensagem.'); } } }; xhr.send(JSON.stringify(data)); }); });