feat(contactos): embed the FitMe app contact form

Replaces the Zoho form in the contacts section with the app.fitme3070.pt
site-contacto iframe (passes page URL and UTM params, auto-height).
This commit is contained in:
andre committed 2026-10-27 13:47:35 +00:00
1 parent f297e128fd
commit f018fa582d
1 file changed
+15 -30
+15 -30
View File
@@ -83,36 +83,21 @@ $session = session();
<div class="col-lg-8">
<div id="contact-form">
<h3 class="contact-title text-center text-md-left">Envia-nos uma mensagem</h3>
<?php if (isset($_GET['enviado'])): ?>
<div class="alert alert-success" role="alert">
Mensagem enviada com sucesso! Entraremos em contacto brevemente.
</div>
<?php endif; ?>
<form class="contact-form" method="post" action="https://forms.zohopublic.eu/fitme30701/form/FormulriodeContacto/formperma/NiwsTjwWGX2sgpZIXqE5otyAn8D5nuRQjpYDuGkS2wM/htmlRecords/submit">
<input type="hidden" name="zf_redirect_url" value="<?= base_url('?enviado=1#contact-form') ?>">
<div class="row">
<div class="col-md-6">
<input type="text" required name="SingleLine" placeholder="Nome" aria-label="Nome">
</div>
<div class="col-md-6">
<input type="text" required name="PhoneNumber_countrycode" placeholder="Telemóvel" aria-label="Telemóvel">
</div>
</div>
<input type="text" name="SingleLine1" placeholder="Razão" required value="<?= htmlspecialchars($assunto) ?>" aria-label="Razão do contacto">
<textarea name="MultiLine" placeholder="Mensagem" required aria-label="Mensagem"></textarea>
<?php if ($session->getFlashdata('email') !== null): ?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?= $session->getFlashdata('email') ?>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<?php endif; ?>
<label class="consent-check">
<?php /* no name attribute: gates submission client-side, not stored in Zoho */ ?>
<input type="checkbox" required>
<span>Li e aceito a <a href="<?= base_url('home/privacidade') ?>" target="_blank" rel="noopener">Política de Privacidade</a>.</span>
</label>
<button class="site-btn" id="btn_email" type="submit">Enviar Mensagem</button>
</form>
<?php /* Formulário da app FitMe (app.fitme3070.pt), em iframe; a altura acompanha o conteúdo via postMessage. */ ?>
<div id="fitme-form-site-contacto-wrap"></div>
<script>
(function () {
var p = new URLSearchParams(location.search), q = new URLSearchParams({ embed: "1", page: location.href });
["utm_source","utm_medium","utm_campaign","utm_content","utm_term"].forEach(function (k) { if (p.get(k)) q.set(k, p.get(k)); });
var f = document.createElement("iframe");
f.src = "https://app.fitme3070.pt/f/site-contacto?" + q.toString(); f.id = "fitme-form-site-contacto"; f.title = "Envia-nos uma Mensagem";
f.style.cssText = "width:100%;max-width:480px;border:0;"; f.height = "640"; f.loading = "lazy";
document.getElementById("fitme-form-site-contacto-wrap").appendChild(f);
window.addEventListener("message", function (e) {
if (e.origin === "https://app.fitme3070.pt" && e.data && e.data.type === "fitme-form-height" && e.data.slug === "site-contacto") f.style.height = e.data.height + "px";
});
})();
</script>
</div>
</div>
</div>