Skip to content

Commit 5ca7ec2

Browse files
author
PrintableTools Lab Bot
committed
Add fast sponsor invoice review form
1 parent 1c9eabc commit 5ca7ec2

35 files changed

Lines changed: 443 additions & 188 deletions

app.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7752,6 +7752,28 @@ ${paragraphs.join("\n")}
77527752
<li>Payment, tax, bank, phone, and private identity details stay outside this form.</li>
77537753
</ul>
77547754
</div>
7755+
<form class="panel form-grid sponsor-quick-form" data-sponsor-quick-form>
7756+
<input class="sr-only" type="text" name="websiteTrap" tabindex="-1" autocomplete="off" aria-hidden="true">
7757+
<input type="hidden" name="dealId">
7758+
<h3>Fast pilot invoice review</h3>
7759+
<p class="help">Three business-safe fields. This requests manual fit review only; any invoice or agreement is sent later through an external provider. Do not send private payment, tax, phone, identity, password, or customer-file details.</p>
7760+
<label class="field">
7761+
<span>Company or project</span>
7762+
<input name="company" maxlength="90" autocomplete="organization" required>
7763+
</label>
7764+
<label class="field">
7765+
<span>Business email</span>
7766+
<input name="contactEmail" type="email" maxlength="140" autocomplete="email" required>
7767+
</label>
7768+
<label class="field">
7769+
<span>Website</span>
7770+
<input name="website" type="url" maxlength="220" placeholder="https://example.com" autocomplete="url" required>
7771+
</label>
7772+
<div class="actions">
7773+
<button class="button" type="submit" data-track-event="sponsor_request_intent" data-track-tool="sponsor">Request pilot invoice review</button>
7774+
</div>
7775+
<p class="help sponsor-lead-status" data-sponsor-lead-status role="status" aria-live="polite">No payment is collected here.</p>
7776+
</form>
77557777
<form class="panel form-grid sponsor-lead-form" data-sponsor-lead-form>
77567778
<input class="sr-only" type="text" name="websiteTrap" tabindex="-1" autocomplete="off" aria-hidden="true">
77577779
<input type="hidden" name="dealId">
@@ -12571,6 +12593,15 @@ ${paragraphs.join("\n")}
1257112593
await submitSponsorLeadForm(form);
1257212594
});
1257312595
});
12596+
root.querySelectorAll("[data-sponsor-quick-form]").forEach((form) => {
12597+
if (form.dataset.boundSponsorQuickLead === "true") return;
12598+
form.dataset.boundSponsorQuickLead = "true";
12599+
applySponsorDealPrefill(form, sponsorDealPrefillFromUrl() || loadSponsorDealPrefill() || sponsorDealPrefillFromDeal(sponsorDeals.find((deal) => deal.id === "guide-sponsor-pilot") || sponsorDeals[0]));
12600+
form.addEventListener("submit", async (event) => {
12601+
event.preventDefault();
12602+
await submitSponsorQuickLeadForm(form);
12603+
});
12604+
});
1257412605
}
1257512606

1257612607
function sponsorDealPrefillFromUrl() {
@@ -12681,6 +12712,50 @@ ${paragraphs.join("\n")}
1268112712
}
1268212713
}
1268312714

12715+
async function submitSponsorQuickLeadForm(form) {
12716+
const values = getFormValues(form);
12717+
const deal = sponsorDeals.find((item) => item.id === values.dealId) || sponsorDeals.find((item) => item.id === "guide-sponsor-pilot") || sponsorDeals[0];
12718+
const status = form.querySelector("[data-sponsor-lead-status]");
12719+
const submit = form.querySelector("button[type='submit']");
12720+
const setStatus = (message, kind = "") => {
12721+
if (!status) return;
12722+
status.textContent = message;
12723+
status.dataset.status = kind;
12724+
};
12725+
const payload = {
12726+
...values,
12727+
dealId: deal.id,
12728+
placement: deal.placement,
12729+
budgetRange: deal.budgetRange,
12730+
timeline: deal.timeline,
12731+
commitment: sponsorDealCommitment(deal),
12732+
audienceFit: `Fast invoice review request for ${deal.title}; sponsor says their website may fit PrintableTools Lab's free PDF, image, QR, career, classroom, or small-business workflows.`,
12733+
notes: `${deal.title} (${deal.price}). ${deal.deliverable} Needed: ${deal.proofNeeded}`,
12734+
consent: true,
12735+
path: getCurrentRoutePath(),
12736+
source: getTrafficSource(),
12737+
...getSponsorAttribution(),
12738+
};
12739+
setStatus("Sending fast invoice review request...", "pending");
12740+
if (submit) submit.disabled = true;
12741+
try {
12742+
const response = await fetch("/api/sponsor-lead", {
12743+
method: "POST",
12744+
headers: { "Content-Type": "application/json" },
12745+
body: JSON.stringify(payload),
12746+
});
12747+
const data = await response.json().catch(() => ({}));
12748+
if (!response.ok || !data.ok) throw new Error(data.error || "Could not send request.");
12749+
track("sponsor_request_intent", { tool: "sponsor" });
12750+
setStatus("Invoice review request received. Fit will be checked manually before any external invoice or agreement is sent.", "success");
12751+
form.reset();
12752+
} catch (error) {
12753+
setStatus(error.message || "Could not send request. Please use the full inquiry form.", "error");
12754+
} finally {
12755+
if (submit) submit.disabled = false;
12756+
}
12757+
}
12758+
1268412759
function getSessionSource() {
1268512760
try {
1268612761
return sessionStorage.getItem("ptl_source");

discovery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "PrintableTools Lab",
33
"url": "https://printable-tools-lab.pages.dev/",
4-
"generatedAt": "2026-06-07T19:10:30.543Z",
4+
"generatedAt": "2026-06-07T19:16:10.577Z",
55
"positioning": "Free no-signup browser PDF, image, and QR tools with local generation, original guides, and responsible ad placement after approval.",
66
"feed": "https://printable-tools-lab.pages.dev/feed.xml",
77
"manifest": "https://printable-tools-lab.pages.dev/site.webmanifest",

docs/game-submission-feed.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "HTML5 Game Submission Feed",
3-
"generatedAt": "2026-06-07T19:10:30.630Z",
3+
"generatedAt": "2026-06-07T19:16:10.665Z",
44
"directory": "https://yanqr213.github.io/printable-tools-lab/html5-game-submission-pack/",
55
"mainSubmissionPack": "https://printable-tools-lab.pages.dev/portal-submission-pack/",
66
"purpose": "Public machine-readable feed for HTML5 game portals and reviewers. It lists playable builds, clean ZIPs, SDK packages, demo videos, review reports, and ad-safety notes without private account or payout data.",

docs/games.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "HTML5 Game Submission Feed",
3-
"generatedAt": "2026-06-07T19:10:30.630Z",
3+
"generatedAt": "2026-06-07T19:16:10.665Z",
44
"directory": "https://yanqr213.github.io/printable-tools-lab/html5-game-submission-pack/",
55
"mainSubmissionPack": "https://printable-tools-lab.pages.dev/portal-submission-pack/",
66
"purpose": "Public machine-readable feed for HTML5 game portals and reviewers. It lists playable builds, clean ZIPs, SDK packages, demo videos, review reports, and ad-safety notes without private account or payout data.",

docs/organic-push-kit.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "PrintableTools Lab Organic Push Kit Mirror",
3-
"generatedAt": "2026-06-07T19:10:30.630Z",
3+
"generatedAt": "2026-06-07T19:16:10.665Z",
44
"directory": "https://yanqr213.github.io/printable-tools-lab/organic-push-kit/",
55
"livePage": "https://printable-tools-lab.pages.dev/organic-push-kit/",
66
"liveJson": "https://printable-tools-lab.pages.dev/organic-push-kit.json",

docs/sponsor-call.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "PrintableTools Lab Sponsor Call Mirror",
3-
"generatedAt": "2026-06-07T19:10:30.630Z",
3+
"generatedAt": "2026-06-07T19:16:10.665Z",
44
"directory": "https://yanqr213.github.io/printable-tools-lab/sponsor-call/",
55
"livePage": "https://printable-tools-lab.pages.dev/sponsor-call/",
66
"liveJson": "https://printable-tools-lab.pages.dev/sponsor-call.json",

docs/sponsor-deal-room.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "PrintableTools Lab Sponsor Deal Room Mirror",
3-
"generatedAt": "2026-06-07T19:10:30.630Z",
3+
"generatedAt": "2026-06-07T19:16:10.665Z",
44
"directory": "https://yanqr213.github.io/printable-tools-lab/sponsor-deal-room/",
55
"livePage": "https://printable-tools-lab.pages.dev/sponsor-deal-room/",
66
"liveJson": "https://printable-tools-lab.pages.dev/sponsor-deal-room.json",

docs/sponsor-opportunities.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "PrintableTools Lab Sponsor Opportunities Mirror",
3-
"generatedAt": "2026-06-07T19:10:30.630Z",
3+
"generatedAt": "2026-06-07T19:16:10.665Z",
44
"directory": "https://yanqr213.github.io/printable-tools-lab/sponsor-opportunities/",
55
"livePage": "https://printable-tools-lab.pages.dev/sponsor-opportunities/",
66
"liveJson": "https://printable-tools-lab.pages.dev/sponsor-opportunities.json",

docs/tools.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"finder": "https://printable-tools-lab.pages.dev/pdf-tool-finder/",
66
"feed": "https://printable-tools-lab.pages.dev/feed.xml",
77
"githubPagesDirectory": "https://yanqr213.github.io/printable-tools-lab/",
8-
"generatedAt": "2026-06-07T19:10:30.630Z",
8+
"generatedAt": "2026-06-07T19:16:10.665Z",
99
"landingPages": [
1010
{
1111
"title": "Free Upload Limit Fixer",
@@ -1559,7 +1559,7 @@
15591559
},
15601560
"organicPushKit": {
15611561
"name": "PrintableTools Lab Organic Push Kit Mirror",
1562-
"generatedAt": "2026-06-07T19:10:30.630Z",
1562+
"generatedAt": "2026-06-07T19:16:10.665Z",
15631563
"directory": "https://yanqr213.github.io/printable-tools-lab/organic-push-kit/",
15641564
"livePage": "https://printable-tools-lab.pages.dev/organic-push-kit/",
15651565
"liveJson": "https://printable-tools-lab.pages.dev/organic-push-kit.json",
@@ -1656,7 +1656,7 @@
16561656
},
16571657
"uploadErrorCheatsheet": {
16581658
"name": "PrintableTools Lab Upload Error Cheatsheet Mirror",
1659-
"generatedAt": "2026-06-07T19:10:30.630Z",
1659+
"generatedAt": "2026-06-07T19:16:10.665Z",
16601660
"directory": "https://yanqr213.github.io/printable-tools-lab/upload-error-cheatsheet/",
16611661
"livePage": "https://printable-tools-lab.pages.dev/upload-error-cheatsheet/",
16621662
"liveJson": "https://printable-tools-lab.pages.dev/upload-error-cheatsheet.json",
@@ -1803,7 +1803,7 @@
18031803
},
18041804
"sponsorDealRoom": {
18051805
"name": "PrintableTools Lab Sponsor Deal Room Mirror",
1806-
"generatedAt": "2026-06-07T19:10:30.630Z",
1806+
"generatedAt": "2026-06-07T19:16:10.665Z",
18071807
"directory": "https://yanqr213.github.io/printable-tools-lab/sponsor-deal-room/",
18081808
"livePage": "https://printable-tools-lab.pages.dev/sponsor-deal-room/",
18091809
"liveJson": "https://printable-tools-lab.pages.dev/sponsor-deal-room.json",
@@ -1907,7 +1907,7 @@
19071907
},
19081908
"sponsorCall": {
19091909
"name": "PrintableTools Lab Sponsor Call Mirror",
1910-
"generatedAt": "2026-06-07T19:10:30.630Z",
1910+
"generatedAt": "2026-06-07T19:16:10.665Z",
19111911
"directory": "https://yanqr213.github.io/printable-tools-lab/sponsor-call/",
19121912
"livePage": "https://printable-tools-lab.pages.dev/sponsor-call/",
19131913
"liveJson": "https://printable-tools-lab.pages.dev/sponsor-call.json",
@@ -2016,7 +2016,7 @@
20162016
},
20172017
"sponsorOpportunities": {
20182018
"name": "PrintableTools Lab Sponsor Opportunities Mirror",
2019-
"generatedAt": "2026-06-07T19:10:30.630Z",
2019+
"generatedAt": "2026-06-07T19:16:10.665Z",
20202020
"directory": "https://yanqr213.github.io/printable-tools-lab/sponsor-opportunities/",
20212021
"livePage": "https://printable-tools-lab.pages.dev/sponsor-opportunities/",
20222022
"liveJson": "https://printable-tools-lab.pages.dev/sponsor-opportunities.json",

docs/upload-error-cheatsheet.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "PrintableTools Lab Upload Error Cheatsheet Mirror",
3-
"generatedAt": "2026-06-07T19:10:30.630Z",
3+
"generatedAt": "2026-06-07T19:16:10.665Z",
44
"directory": "https://yanqr213.github.io/printable-tools-lab/upload-error-cheatsheet/",
55
"livePage": "https://printable-tools-lab.pages.dev/upload-error-cheatsheet/",
66
"liveJson": "https://printable-tools-lab.pages.dev/upload-error-cheatsheet.json",

0 commit comments

Comments
 (0)