Add a hero image (rendered from the redesigned PDF's own cover) so the opt-in page shows the actual resource instead of pure text, and make the post-submit message PDF-specific with a working /gift-thanks fallback link instead of a generic dead-end "check your inbox" line. Both are opt-in per-page params (hero_image, success_message) so the real drip-course page's rendering is unchanged.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
var form = document.getElementById("enroll-form-{{ $id }}");
|
||||
var status = document.getElementById("enroll-status-{{ $id }}");
|
||||
var slug = {{ $page.Params.eec_slug }};
|
||||
var successMessage = {{ ($page.Params.success_message | default "Check your inbox — let us know you're ready and we'll get started.") | markdownify }};
|
||||
form.addEventListener("submit", function (e) {
|
||||
e.preventDefault();
|
||||
if (form.website.value) return; // honeypot
|
||||
@@ -32,7 +33,7 @@
|
||||
if (res.ok) {
|
||||
form.reset();
|
||||
form.hidden = true;
|
||||
status.textContent = "Check your inbox — let us know you're ready and we'll get started.";
|
||||
status.innerHTML = successMessage;
|
||||
return;
|
||||
}
|
||||
return res.text().then(function (msg) {
|
||||
|
||||
Reference in New Issue
Block a user