UEA-PRODEM
This commit is contained in:
@@ -220,6 +220,7 @@ function App() {
|
||||
|
||||
{/* UEA-PRODEM Ambiente Personalizado */}
|
||||
<Route path="/uea-prodem-angola" element={<UeaProdem />} />
|
||||
<Route path="/uea-prodem" element={<UeaProdem />} />
|
||||
|
||||
{/* Contato */}
|
||||
<Route path="/contato" element={<Contato />} />
|
||||
|
||||
+40
-28
@@ -93,42 +93,54 @@ const Contato = () => {
|
||||
return () => ctx.revert();
|
||||
}, []);
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
setIsSubmitting(true);
|
||||
|
||||
// Enviar ao Mautic (Form ID 4) - sincrono via iframe
|
||||
const mauticSuccess = sendLeadToMautic('contato', {
|
||||
nome: formData.nome,
|
||||
email: formData.email,
|
||||
empresa: formData.empresa,
|
||||
telefone: formData.telefone,
|
||||
servico_interesse: formData.servico,
|
||||
mensagem: formData.mensagem,
|
||||
origem_lead: 'contato_site',
|
||||
});
|
||||
|
||||
if (!mauticSuccess) {
|
||||
// Enviar ao Formspree
|
||||
try {
|
||||
const response = await fetch('https://formspree.io/f/xwvjqyrr', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
nome: formData.nome,
|
||||
email: formData.email,
|
||||
empresa: formData.empresa,
|
||||
telefone: formData.telefone,
|
||||
servico: formData.servico,
|
||||
mensagem: formData.mensagem,
|
||||
}),
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
setIsSubmitted(true);
|
||||
setFormData({ nome: '', email: '', empresa: '', telefone: '', servico: '', mensagem: '' });
|
||||
|
||||
// Google Ads conversion tracking
|
||||
trackConversion();
|
||||
|
||||
// Facebook Pixel - Lead
|
||||
trackFacebookPixel('Lead', {
|
||||
content_name: 'Formulario Contato',
|
||||
content_category: 'lead_contato',
|
||||
});
|
||||
|
||||
setTimeout(() => setIsSubmitted(false), 5000);
|
||||
} else {
|
||||
alert('Erro ao enviar. Tente novamente ou use o WhatsApp.');
|
||||
}
|
||||
} catch {
|
||||
// Fallback: enviar via mailto se Formspree falhar
|
||||
sendLeadViaMailto({
|
||||
nome: formData.nome,
|
||||
email: formData.email,
|
||||
});
|
||||
} finally {
|
||||
setIsSubmitting(false);
|
||||
}
|
||||
|
||||
// Google Ads conversion tracking
|
||||
trackConversion();
|
||||
|
||||
// Facebook Pixel - Lead
|
||||
trackFacebookPixel('Lead', {
|
||||
content_name: 'Formulario Contato',
|
||||
content_category: 'lead_contato',
|
||||
});
|
||||
|
||||
setIsSubmitting(false);
|
||||
setIsSubmitted(true);
|
||||
setFormData({ nome: '', email: '', empresa: '', telefone: '', servico: '', mensagem: '' });
|
||||
|
||||
setTimeout(() => setIsSubmitted(false), 5000);
|
||||
};
|
||||
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => {
|
||||
|
||||
Reference in New Issue
Block a user