- add reCaptcha logic to form
- use data variables
This commit is contained in:
parent
183f93ba4e
commit
10a33e006b
@ -1,10 +1,10 @@
|
||||
{
|
||||
"build": {
|
||||
"id": "36ee14fe-0c68-48a1-be4a-6aa499bfd0ef",
|
||||
"id": "a1a86306-3d77-4eb6-96f2-051b0f8c8c3b",
|
||||
"projectId": "363652e3-9846-4534-acdf-9b2b3c66eec0",
|
||||
"version": 5364,
|
||||
"createdAt": "2026-01-12T08:23:59.138+00:00",
|
||||
"updatedAt": "2026-01-12T08:23:59.138+00:00",
|
||||
"version": 5726,
|
||||
"createdAt": "2026-01-13T13:56:21.144+00:00",
|
||||
"updatedAt": "2026-01-13T13:56:21.144+00:00",
|
||||
"pages": {
|
||||
"meta": {
|
||||
"siteName": "Inasa Healthcare",
|
||||
@ -11650,19 +11650,6 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"YU_JVXl0Uk-97Cz2EDdcj:5zaWVFAeAfWgFjJNQ0GET:maxHeight:",
|
||||
{
|
||||
"breakpointId": "5zaWVFAeAfWgFjJNQ0GET",
|
||||
"styleSourceId": "YU_JVXl0Uk-97Cz2EDdcj",
|
||||
"property": "maxHeight",
|
||||
"value": {
|
||||
"type": "unit",
|
||||
"unit": "%",
|
||||
"value": 100
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"UJTpjUHtMgi8NFW_ip_Da:5zaWVFAeAfWgFjJNQ0GET:marginTop:",
|
||||
{
|
||||
@ -24854,7 +24841,7 @@
|
||||
"property": "flexDirection",
|
||||
"value": {
|
||||
"type": "keyword",
|
||||
"value": "row"
|
||||
"value": "column-reverse"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -29852,6 +29839,106 @@
|
||||
"value": 1.5
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"hmN5UwWsDO2NiO40UdfZI:5zaWVFAeAfWgFjJNQ0GET:rowGap:",
|
||||
{
|
||||
"breakpointId": "5zaWVFAeAfWgFjJNQ0GET",
|
||||
"styleSourceId": "hmN5UwWsDO2NiO40UdfZI",
|
||||
"property": "rowGap",
|
||||
"value": {
|
||||
"type": "unit",
|
||||
"unit": "rem",
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"hmN5UwWsDO2NiO40UdfZI:5zaWVFAeAfWgFjJNQ0GET:columnGap:",
|
||||
{
|
||||
"breakpointId": "5zaWVFAeAfWgFjJNQ0GET",
|
||||
"styleSourceId": "hmN5UwWsDO2NiO40UdfZI",
|
||||
"property": "columnGap",
|
||||
"value": {
|
||||
"type": "unit",
|
||||
"unit": "rem",
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"M8Brpr2zKZ39TkpfCNUoN:5zaWVFAeAfWgFjJNQ0GET:display:",
|
||||
{
|
||||
"breakpointId": "5zaWVFAeAfWgFjJNQ0GET",
|
||||
"styleSourceId": "M8Brpr2zKZ39TkpfCNUoN",
|
||||
"property": "display",
|
||||
"value": {
|
||||
"type": "keyword",
|
||||
"value": "flex"
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"M8Brpr2zKZ39TkpfCNUoN:5zaWVFAeAfWgFjJNQ0GET:flexDirection:",
|
||||
{
|
||||
"breakpointId": "5zaWVFAeAfWgFjJNQ0GET",
|
||||
"styleSourceId": "M8Brpr2zKZ39TkpfCNUoN",
|
||||
"property": "flexDirection",
|
||||
"value": {
|
||||
"type": "keyword",
|
||||
"value": "row"
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"M8Brpr2zKZ39TkpfCNUoN:5zaWVFAeAfWgFjJNQ0GET:alignItems:",
|
||||
{
|
||||
"breakpointId": "5zaWVFAeAfWgFjJNQ0GET",
|
||||
"styleSourceId": "M8Brpr2zKZ39TkpfCNUoN",
|
||||
"property": "alignItems",
|
||||
"value": {
|
||||
"type": "keyword",
|
||||
"value": "center"
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"M8Brpr2zKZ39TkpfCNUoN:5zaWVFAeAfWgFjJNQ0GET:justifyContent:",
|
||||
{
|
||||
"breakpointId": "5zaWVFAeAfWgFjJNQ0GET",
|
||||
"styleSourceId": "M8Brpr2zKZ39TkpfCNUoN",
|
||||
"property": "justifyContent",
|
||||
"value": {
|
||||
"type": "keyword",
|
||||
"value": "center"
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"M8Brpr2zKZ39TkpfCNUoN:5zaWVFAeAfWgFjJNQ0GET:marginTop:",
|
||||
{
|
||||
"breakpointId": "5zaWVFAeAfWgFjJNQ0GET",
|
||||
"styleSourceId": "M8Brpr2zKZ39TkpfCNUoN",
|
||||
"property": "marginTop",
|
||||
"value": {
|
||||
"type": "unit",
|
||||
"unit": "rem",
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"M8Brpr2zKZ39TkpfCNUoN:5zaWVFAeAfWgFjJNQ0GET:fontSize:",
|
||||
{
|
||||
"breakpointId": "5zaWVFAeAfWgFjJNQ0GET",
|
||||
"styleSourceId": "M8Brpr2zKZ39TkpfCNUoN",
|
||||
"property": "fontSize",
|
||||
"value": {
|
||||
"type": "unit",
|
||||
"unit": "rem",
|
||||
"value": 1.6
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"styleSources": [
|
||||
@ -30422,13 +30509,6 @@
|
||||
"id": "iw1Q6OdZAPELpgb3F7oK6"
|
||||
}
|
||||
],
|
||||
[
|
||||
"YU_JVXl0Uk-97Cz2EDdcj",
|
||||
{
|
||||
"type": "local",
|
||||
"id": "YU_JVXl0Uk-97Cz2EDdcj"
|
||||
}
|
||||
],
|
||||
[
|
||||
"Wgb8m4OIno_nlhLwtkk58",
|
||||
{
|
||||
@ -31590,6 +31670,13 @@
|
||||
"type": "local",
|
||||
"id": "GqpFBBFprgpQFFazEUGaI"
|
||||
}
|
||||
],
|
||||
[
|
||||
"M8Brpr2zKZ39TkpfCNUoN",
|
||||
{
|
||||
"type": "local",
|
||||
"id": "M8Brpr2zKZ39TkpfCNUoN"
|
||||
}
|
||||
]
|
||||
],
|
||||
"styleSourceSelections": [
|
||||
@ -32322,15 +32409,6 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"ou67ykSR-Zjofp9sxojmK",
|
||||
{
|
||||
"instanceId": "ou67ykSR-Zjofp9sxojmK",
|
||||
"values": [
|
||||
"YU_JVXl0Uk-97Cz2EDdcj"
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"PlUo-sDyudQJpclgkqR6P",
|
||||
{
|
||||
@ -33824,6 +33902,15 @@
|
||||
"GqpFBBFprgpQFFazEUGaI"
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"ohhe3SozVAasVdjYbb_Ek",
|
||||
{
|
||||
"instanceId": "ohhe3SozVAasVdjYbb_Ek",
|
||||
"values": [
|
||||
"M8Brpr2zKZ39TkpfCNUoN"
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
"props": [
|
||||
@ -34207,26 +34294,6 @@
|
||||
"value": "top"
|
||||
}
|
||||
],
|
||||
[
|
||||
"0WwGDCiPl0XyPzqrPxEkk",
|
||||
{
|
||||
"id": "0WwGDCiPl0XyPzqrPxEkk",
|
||||
"instanceId": "ou67ykSR-Zjofp9sxojmK",
|
||||
"name": "width",
|
||||
"type": "number",
|
||||
"value": 1024
|
||||
}
|
||||
],
|
||||
[
|
||||
"MP5Itd93U7UV_nQQq4h1o",
|
||||
{
|
||||
"id": "MP5Itd93U7UV_nQQq4h1o",
|
||||
"instanceId": "ou67ykSR-Zjofp9sxojmK",
|
||||
"name": "height",
|
||||
"type": "number",
|
||||
"value": 1024
|
||||
}
|
||||
],
|
||||
[
|
||||
"YQAC_-_Svo7HBRqQgaDzR",
|
||||
{
|
||||
@ -34237,36 +34304,6 @@
|
||||
"value": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"n0y29xhCYbyGyFsZckInZ",
|
||||
{
|
||||
"id": "n0y29xhCYbyGyFsZckInZ",
|
||||
"instanceId": "ou67ykSR-Zjofp9sxojmK",
|
||||
"name": "data-ws-show",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"Bp13ug0Msx1Rja5Wb1zGO",
|
||||
{
|
||||
"id": "Bp13ug0Msx1Rja5Wb1zGO",
|
||||
"instanceId": "W8jtnflh3Z1AsqLxvVYUW",
|
||||
"name": "code",
|
||||
"type": "string",
|
||||
"value": "<link href=\"https://api.mapbox.com/mapbox-gl-js/v3.4.0/mapbox-gl.css\" rel=\"stylesheet\">\n<script src=\"https://api.mapbox.com/mapbox-gl-js/v3.1.2/mapbox-gl.js\"></script>\n<style>\n body { margin: 0; padding: 0; }\n #map { width: 100%; height: 100% }\n</style>\n<script>\n\t// TO MAKE THE MAP APPEAR YOU MUST\n\t// ADD YOUR ACCESS TOKEN FROM\n\t// https://account.mapbox.com\n mapboxgl.accessToken = 'sk.eyJ1IjoiYnNpZGUtZGV2IiwiYSI6ImNtaWsyd254eDE5M2szZHB4aWR2ZnFveDUifQ.oa-Kf1sbA--WyIJ2UmV8lg';\n const map = new mapboxgl.Map({\n container: 'map', // container ID\n center: [-74.5, 40], // starting position [lng, lat]. Note that lat must be set between -90 and 90\n zoom: 9 // starting zoom\n });\n</script>\n"
|
||||
}
|
||||
],
|
||||
[
|
||||
"h2wxMDLjOHFJwvE98eusV",
|
||||
{
|
||||
"id": "h2wxMDLjOHFJwvE98eusV",
|
||||
"instanceId": "W8jtnflh3Z1AsqLxvVYUW",
|
||||
"name": "executeScriptOnCanvas",
|
||||
"type": "boolean",
|
||||
"value": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"A9rI81SPVGWoevAUqxyU_",
|
||||
{
|
||||
@ -34277,16 +34314,6 @@
|
||||
"value": "map"
|
||||
}
|
||||
],
|
||||
[
|
||||
"KxGGKVx3DhNKkLU-fS8qj",
|
||||
{
|
||||
"id": "KxGGKVx3DhNKkLU-fS8qj",
|
||||
"instanceId": "W8jtnflh3Z1AsqLxvVYUW",
|
||||
"name": "data-ws-show",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"fthq7HaYOU7l1oxDFqVQd",
|
||||
{
|
||||
@ -34344,7 +34371,7 @@
|
||||
"instanceId": "FWErf923dUrcCtRUj8GsR",
|
||||
"name": "executeScriptOnCanvas",
|
||||
"type": "boolean",
|
||||
"value": true
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
[
|
||||
@ -34364,7 +34391,7 @@
|
||||
"instanceId": "FWErf923dUrcCtRUj8GsR",
|
||||
"name": "data-ws-show",
|
||||
"type": "boolean",
|
||||
"value": true
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
[
|
||||
@ -34917,16 +34944,6 @@
|
||||
"value": true
|
||||
}
|
||||
],
|
||||
[
|
||||
"DiwkydZz1HgIpmsYCBlt_",
|
||||
{
|
||||
"id": "DiwkydZz1HgIpmsYCBlt_",
|
||||
"instanceId": "W8jtnflh3Z1AsqLxvVYUW",
|
||||
"name": "clientOnly",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"FXpFh5Ib6sD6y4Utas8KN",
|
||||
{
|
||||
@ -35347,16 +35364,6 @@
|
||||
"value": "contact.form"
|
||||
}
|
||||
],
|
||||
[
|
||||
"xsqMcGlcexYl6oKu9Lnj3",
|
||||
{
|
||||
"id": "xsqMcGlcexYl6oKu9Lnj3",
|
||||
"instanceId": "cKY_3FKN7Ei4biJP9ypIe",
|
||||
"name": "method",
|
||||
"type": "string",
|
||||
"value": "post"
|
||||
}
|
||||
],
|
||||
[
|
||||
"WVJHscS_6KyJez5Bnwxz0",
|
||||
{
|
||||
@ -35786,6 +35793,186 @@
|
||||
"type": "string",
|
||||
"value": "https://d2oe0ra32qx05a.cloudfront.net/?practiceKey=k_1_112536"
|
||||
}
|
||||
],
|
||||
[
|
||||
"_YRVG2iQec48vZ4G1HsIV",
|
||||
{
|
||||
"id": "_YRVG2iQec48vZ4G1HsIV",
|
||||
"instanceId": "4JXxrWgnFmy0B_HMj5tvo",
|
||||
"name": "class",
|
||||
"type": "string",
|
||||
"value": "g-recaptcha"
|
||||
}
|
||||
],
|
||||
[
|
||||
"27yIb0mN8jP6ZBLJSkfE4",
|
||||
{
|
||||
"id": "27yIb0mN8jP6ZBLJSkfE4",
|
||||
"instanceId": "4JXxrWgnFmy0B_HMj5tvo",
|
||||
"name": "id",
|
||||
"type": "string",
|
||||
"value": "contact.recaptcha"
|
||||
}
|
||||
],
|
||||
[
|
||||
"inGSZuK5zMW65-P7GNZiA",
|
||||
{
|
||||
"id": "inGSZuK5zMW65-P7GNZiA",
|
||||
"instanceId": "4JXxrWgnFmy0B_HMj5tvo",
|
||||
"name": "data-sitekey",
|
||||
"type": "expression",
|
||||
"value": "$ws$dataSource$qflNJelh0xPeaQeueFdRx"
|
||||
}
|
||||
],
|
||||
[
|
||||
"g-Vs-HpdDM_7pAHjCq2IA",
|
||||
{
|
||||
"id": "g-Vs-HpdDM_7pAHjCq2IA",
|
||||
"instanceId": "2CJC9HxyYFc3Cmv0acnQF",
|
||||
"name": "code",
|
||||
"type": "string",
|
||||
"value": "<script src=\"https://www.google.com/recaptcha/api.js\" async defer></script>"
|
||||
}
|
||||
],
|
||||
[
|
||||
"uXKrrMLQBRNrXxzAytghn",
|
||||
{
|
||||
"id": "uXKrrMLQBRNrXxzAytghn",
|
||||
"instanceId": "2CJC9HxyYFc3Cmv0acnQF",
|
||||
"name": "executeScriptOnCanvas",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"7qGku_zJTHLCjG2UKjpnW",
|
||||
{
|
||||
"id": "7qGku_zJTHLCjG2UKjpnW",
|
||||
"instanceId": "96r3Sh5syWTmhAhu_oz5M",
|
||||
"name": "data-sitekey",
|
||||
"type": "expression",
|
||||
"value": "$ws$dataSource$qflNJelh0xPeaQeueFdRx"
|
||||
}
|
||||
],
|
||||
[
|
||||
"cYgiIZiUVatouiOCmXLYC",
|
||||
{
|
||||
"id": "cYgiIZiUVatouiOCmXLYC",
|
||||
"instanceId": "96r3Sh5syWTmhAhu_oz5M",
|
||||
"name": "class",
|
||||
"type": "string",
|
||||
"value": "g-recaptcha"
|
||||
}
|
||||
],
|
||||
[
|
||||
"AxNhuEIEBh2bzh-nrIO27",
|
||||
{
|
||||
"id": "AxNhuEIEBh2bzh-nrIO27",
|
||||
"instanceId": "4JXxrWgnFmy0B_HMj5tvo",
|
||||
"name": "data-ws-show",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"VfneGb9XwWyXHMF-a7WeK",
|
||||
{
|
||||
"id": "VfneGb9XwWyXHMF-a7WeK",
|
||||
"instanceId": "96r3Sh5syWTmhAhu_oz5M",
|
||||
"name": "data-callback",
|
||||
"type": "string",
|
||||
"value": "onRecaptcha"
|
||||
}
|
||||
],
|
||||
[
|
||||
"ual1zcmuYB2e4J5rf_qEr",
|
||||
{
|
||||
"id": "ual1zcmuYB2e4J5rf_qEr",
|
||||
"instanceId": "96r3Sh5syWTmhAhu_oz5M",
|
||||
"name": "data-action",
|
||||
"type": "string",
|
||||
"value": "submit"
|
||||
}
|
||||
],
|
||||
[
|
||||
"3G5k-0y9beEWn0mLIk4Kv",
|
||||
{
|
||||
"id": "3G5k-0y9beEWn0mLIk4Kv",
|
||||
"instanceId": "96r3Sh5syWTmhAhu_oz5M",
|
||||
"name": "data-badge",
|
||||
"type": "string",
|
||||
"value": "inline"
|
||||
}
|
||||
],
|
||||
[
|
||||
"54GyLypqcQnCf9-XdP8v0",
|
||||
{
|
||||
"id": "54GyLypqcQnCf9-XdP8v0",
|
||||
"instanceId": "96r3Sh5syWTmhAhu_oz5M",
|
||||
"name": "data-size",
|
||||
"type": "string",
|
||||
"value": "invisible"
|
||||
}
|
||||
],
|
||||
[
|
||||
"xnmQjIlKGPBWOBqvTJZJA",
|
||||
{
|
||||
"id": "xnmQjIlKGPBWOBqvTJZJA",
|
||||
"instanceId": "J7gHt8mzlsG2RTsi9Yhbb",
|
||||
"name": "code",
|
||||
"type": "expression",
|
||||
"value": "`<script>\\n async function onRecaptcha(token) {\\n const waitForJobCompletion = (UUID) => {\\n return new Promise(async (resolve, reject) => {\\n try {\\n const endpoint = \\`${$ws$dataSource$OoGpzflLwGU599Of6XYyx}/w/bside-hosted-websites/jobs_u/completed/get_result_maybe/\\${UUID}\\`;\\n const checkResponse = await fetch(endpoint, {\\n method: 'GET',\\n headers: {\\n \\\"Content-Type\\\": \\\"application/json\\\",\\n \\\"Authorization\\\": \\\"Bearer ${$ws$dataSource$tY64kzTEDE4QeLJeMYjs5}\\\"\\n }\\n });\\n \\n const checkData = await checkResponse.json();\\n \\n if (checkData.completed) {\\n document.getElementById('contact.responseMessage').innerText = 'Message sent successfully!';\\n console.log('Success'); \\n document.getElementById('contact.form').reset(); // Clear the form\\n resolve(checkData);\\n } else {\\n // If not completed, wait for a second then try again\\n setTimeout(async () => {\\n const result = await waitForJobCompletion(UUID);\\n resolve(result);\\n }, 1000);\\n }\\n } catch (error) {\\n document.getElementById('contact.responseMessage').innerText = 'Error sending message.';\\n console.error('Error:', error);\\n reject(error);\\n }\\n });\\n }\\n \\n const triggerJob = async () => {\\n const webhookUrl = \\\"${$ws$dataSource$OoGpzflLwGU599Of6XYyx}/w/bside-hosted-websites/jobs/run/p/f/email_automations/send_a_transactional_email_for_website_contact_form\\\"; \\n\\nconst name = document.getElementById('contact.name').value;\\n const subject = document.getElementById('contact.subject').value;\\n const email = document.getElementById('contact.email').value;\\n const message = document.getElementById('contact.message').value;\\n \\n const formData = {\\n auth: ${$ws$dataSource$Dczntj_56W3g4wZnKmj8I},\\n body: {\\n subject,\\n sender: {\\n name: \\\"${$ws$dataSource$SRo4WWU_s3eMhjhz1kDJX} Website Correspondance\\\",\\n email: \\\"site-contact@${$ws$dataSource$Q8IuHMpgxoh8_RHrPMmfT}\\\"\\n },\\n to: [{\\n name: 'No Reply | ${$ws$dataSource$SRo4WWU_s3eMhjhz1kDJX}',\\n email: \\\"info@${$ws$dataSource$Q8IuHMpgxoh8_RHrPMmfT}\\\"\\n }],\\n textContent: \\`\\${name} (\\${email}) has sent the following message:\\\\n\\\\n\\${message}\\`,\\n subject,\\n replyTo: {\\n name,\\n email\\n }\\n }\\n };\\n \\n return await fetch(webhookUrl, {\\n method: 'POST',\\n headers: {\\n \\\"Content-Type\\\": \\\"application/json\\\",\\n \\\"Authorization\\\": \\\"Bearer ${$ws$dataSource$tY64kzTEDE4QeLJeMYjs5}\\\"\\n },\\n body: JSON.stringify(formData) // Send data as JSON\\n })\\n }\\n \\n if (!token.length > 0) {\\n throw new Error(\\\"reCaptcha Token Response missing\\\")\\n }\\n\\n try {\\n const response = await fetch(\\`https://recaptchaenterprise.googleapis.com/v1/projects/bside-hosted-webistes/assessments?key=${$ws$dataSource$OJZ5YZo6QRWG__DASH__6uSajCWc}\\`, {\\n method: 'POST',\\n body: JSON.stringify({\\n \\\"event\\\": {\\n token,\\n siteKey: \"${$ws$dataSource$qflNJelh0xPeaQeueFdRx}\",\\n }\\n })\\n })\\n\\n \\n const data = await response.json()\\n\\n if ('tokenProperties' in data && data.tokenProperties?.valid) {\\n if (document.getElementById('contact.form').reportValidity()) {\\n const jobTriggerResponse = await triggerJob();\\n const UUID = await jobTriggerResponse.text();\\n const jobCompletionData = await waitForJobCompletion(UUID);\\n \\n return jobCompletionData;\\n }\\n }\\n \\n } catch (error) {\\n console.log(error)\\n throw new Error(\\\"reCaptcha Token Response score failed to verify\\\") \\n }\\n }\\n</script>`"
|
||||
}
|
||||
],
|
||||
[
|
||||
"6X0AkNgoisCm37UlklDRW",
|
||||
{
|
||||
"id": "6X0AkNgoisCm37UlklDRW",
|
||||
"instanceId": "J7gHt8mzlsG2RTsi9Yhbb",
|
||||
"name": "executeScriptOnCanvas",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"hYZ32_q0Ju2m2uAjKN8Ob",
|
||||
{
|
||||
"id": "hYZ32_q0Ju2m2uAjKN8Ob",
|
||||
"instanceId": "J7gHt8mzlsG2RTsi9Yhbb",
|
||||
"name": "clientOnly",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"OuaKE2LZy6JC42RAddDGA",
|
||||
{
|
||||
"id": "OuaKE2LZy6JC42RAddDGA",
|
||||
"instanceId": "cKY_3FKN7Ei4biJP9ypIe",
|
||||
"name": "action",
|
||||
"type": "string",
|
||||
"value": "?"
|
||||
}
|
||||
],
|
||||
[
|
||||
"DnEkF5fUOX_8Ro8397f0A",
|
||||
{
|
||||
"id": "DnEkF5fUOX_8Ro8397f0A",
|
||||
"instanceId": "cKY_3FKN7Ei4biJP9ypIe",
|
||||
"name": "method",
|
||||
"type": "string",
|
||||
"value": "post"
|
||||
}
|
||||
],
|
||||
[
|
||||
"HY9tKVw0xZQ7MQGkV0nOH",
|
||||
{
|
||||
"id": "HY9tKVw0xZQ7MQGkV0nOH",
|
||||
"instanceId": "4JXxrWgnFmy0B_HMj5tvo",
|
||||
"name": "data-callback",
|
||||
"type": "string",
|
||||
"value": "onRecaptchaSuccess"
|
||||
}
|
||||
]
|
||||
],
|
||||
"dataSources": [
|
||||
@ -35828,19 +36015,6 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"TCxUvxtiDxgaVM8T3OCVk",
|
||||
{
|
||||
"type": "variable",
|
||||
"id": "TCxUvxtiDxgaVM8T3OCVk",
|
||||
"scopeInstanceId": "FWErf923dUrcCtRUj8GsR",
|
||||
"name": "WEBHOOK_BASE_URL",
|
||||
"value": {
|
||||
"type": "string",
|
||||
"value": "https://windmill.bsidesolutions.net/api/"
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"tY64kzTEDE4QeLJeMYjs5",
|
||||
{
|
||||
@ -35866,6 +36040,45 @@
|
||||
"value": "$res:u/oonyeje/brevo_access_key"
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"qflNJelh0xPeaQeueFdRx",
|
||||
{
|
||||
"type": "variable",
|
||||
"id": "qflNJelh0xPeaQeueFdRx",
|
||||
"scopeInstanceId": "exi1MpHrg9CfkL3fJwvNr",
|
||||
"name": "RECAPTCHA_KEY",
|
||||
"value": {
|
||||
"type": "string",
|
||||
"value": "6LfI0kcsAAAAAFzNYUT50DLtU5RjCbIyOUQ-CXTA"
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"OJZ5YZo6QRWG-6uSajCWc",
|
||||
{
|
||||
"type": "variable",
|
||||
"id": "OJZ5YZo6QRWG-6uSajCWc",
|
||||
"scopeInstanceId": "exi1MpHrg9CfkL3fJwvNr",
|
||||
"name": "RECAPTCHA_API_KEY",
|
||||
"value": {
|
||||
"type": "string",
|
||||
"value": "AIzaSyC38BNWhzaCmJWR7PZT1B7KsfWH9zPMGDY"
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"SRo4WWU_s3eMhjhz1kDJX",
|
||||
{
|
||||
"type": "variable",
|
||||
"id": "SRo4WWU_s3eMhjhz1kDJX",
|
||||
"scopeInstanceId": ":root",
|
||||
"name": "PROJECT_NAME",
|
||||
"value": {
|
||||
"type": "string",
|
||||
"value": "Inasa Healthcare"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"resources": [],
|
||||
@ -37408,6 +37621,10 @@
|
||||
"component": "ws:element",
|
||||
"tag": "section",
|
||||
"children": [
|
||||
{
|
||||
"type": "id",
|
||||
"value": "2CJC9HxyYFc3Cmv0acnQF"
|
||||
},
|
||||
{
|
||||
"type": "id",
|
||||
"value": "sir1L86ob3MdPhstm94Hb"
|
||||
@ -37460,17 +37677,9 @@
|
||||
"component": "ws:element",
|
||||
"tag": "div",
|
||||
"children": [
|
||||
{
|
||||
"type": "id",
|
||||
"value": "ou67ykSR-Zjofp9sxojmK"
|
||||
},
|
||||
{
|
||||
"type": "id",
|
||||
"value": "wF-fRatGsqHUJcTF4L7dP"
|
||||
},
|
||||
{
|
||||
"type": "id",
|
||||
"value": "W8jtnflh3Z1AsqLxvVYUW"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -38075,15 +38284,6 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"ou67ykSR-Zjofp9sxojmK",
|
||||
{
|
||||
"type": "instance",
|
||||
"id": "ou67ykSR-Zjofp9sxojmK",
|
||||
"component": "Image",
|
||||
"children": []
|
||||
}
|
||||
],
|
||||
[
|
||||
"PlUo-sDyudQJpclgkqR6P",
|
||||
{
|
||||
@ -38286,15 +38486,6 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"W8jtnflh3Z1AsqLxvVYUW",
|
||||
{
|
||||
"type": "instance",
|
||||
"id": "W8jtnflh3Z1AsqLxvVYUW",
|
||||
"component": "HtmlEmbed",
|
||||
"children": []
|
||||
}
|
||||
],
|
||||
[
|
||||
"wF-fRatGsqHUJcTF4L7dP",
|
||||
{
|
||||
@ -39469,6 +39660,7 @@
|
||||
"type": "instance",
|
||||
"id": "FWErf923dUrcCtRUj8GsR",
|
||||
"component": "HtmlEmbed",
|
||||
"label": "ContactFormSubmissionScript",
|
||||
"children": []
|
||||
}
|
||||
],
|
||||
@ -41598,6 +41790,10 @@
|
||||
"type": "id",
|
||||
"value": "VyIFtFPr8JzvNc1Wj30Wv"
|
||||
},
|
||||
{
|
||||
"type": "id",
|
||||
"value": "4JXxrWgnFmy0B_HMj5tvo"
|
||||
},
|
||||
{
|
||||
"type": "id",
|
||||
"value": "ohhe3SozVAasVdjYbb_Ek"
|
||||
@ -41753,6 +41949,10 @@
|
||||
"component": "ws:element",
|
||||
"tag": "div",
|
||||
"children": [
|
||||
{
|
||||
"type": "id",
|
||||
"value": "J7gHt8mzlsG2RTsi9Yhbb"
|
||||
},
|
||||
{
|
||||
"type": "id",
|
||||
"value": "96r3Sh5syWTmhAhu_oz5M"
|
||||
@ -43661,6 +43861,37 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"4JXxrWgnFmy0B_HMj5tvo",
|
||||
{
|
||||
"type": "instance",
|
||||
"id": "4JXxrWgnFmy0B_HMj5tvo",
|
||||
"component": "ws:element",
|
||||
"tag": "div",
|
||||
"label": "RecaptchaCheckbox",
|
||||
"children": []
|
||||
}
|
||||
],
|
||||
[
|
||||
"2CJC9HxyYFc3Cmv0acnQF",
|
||||
{
|
||||
"type": "instance",
|
||||
"id": "2CJC9HxyYFc3Cmv0acnQF",
|
||||
"component": "HtmlEmbed",
|
||||
"label": "RecaptchaImportScript",
|
||||
"children": []
|
||||
}
|
||||
],
|
||||
[
|
||||
"J7gHt8mzlsG2RTsi9Yhbb",
|
||||
{
|
||||
"type": "instance",
|
||||
"id": "J7gHt8mzlsG2RTsi9Yhbb",
|
||||
"component": "HtmlEmbed",
|
||||
"label": "RecaptchaContactFormSubmitScript",
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
],
|
||||
"deployment": {
|
||||
|
||||
2
app/__generated__/$.tsx
generated
2
app/__generated__/$.tsx
generated
@ -10,7 +10,7 @@ import { Fragment as Fragment_1, Slot as Slot, HtmlEmbed as HtmlEmbed, Image as
|
||||
|
||||
export const projectId = "363652e3-9846-4534-acdf-9b2b3c66eec0";
|
||||
|
||||
export const lastPublished = "2026-01-12T08:23:59.138Z";
|
||||
export const lastPublished = "2026-01-13T13:56:21.144Z";
|
||||
|
||||
export const siteName = "Inasa Healthcare";
|
||||
|
||||
|
||||
2
app/__generated__/$resources.sitemap.xml.ts
generated
2
app/__generated__/$resources.sitemap.xml.ts
generated
@ -2,7 +2,7 @@
|
||||
export const sitemap = [
|
||||
{
|
||||
"path": "/",
|
||||
"lastModified": "2026-01-12"
|
||||
"lastModified": "2026-01-13"
|
||||
}
|
||||
];
|
||||
|
||||
2
app/__generated__/[about]._index.tsx
generated
2
app/__generated__/[about]._index.tsx
generated
@ -10,7 +10,7 @@ import { Link as Link, Body as Body } from "@webstudio-is/sdk-components-react-r
|
||||
|
||||
export const projectId = "363652e3-9846-4534-acdf-9b2b3c66eec0";
|
||||
|
||||
export const lastPublished = "2026-01-12T08:23:59.138Z";
|
||||
export const lastPublished = "2026-01-13T13:56:21.144Z";
|
||||
|
||||
export const siteName = "Inasa Healthcare";
|
||||
|
||||
|
||||
34
app/__generated__/[contact]._index.tsx
generated
34
app/__generated__/[contact]._index.tsx
generated
@ -10,7 +10,7 @@ import { Link as Link, Body as Body, RemixForm as RemixForm } from "@webstudio-i
|
||||
|
||||
export const projectId = "363652e3-9846-4534-acdf-9b2b3c66eec0";
|
||||
|
||||
export const lastPublished = "2026-01-12T08:23:59.138Z";
|
||||
export const lastPublished = "2026-01-13T13:56:21.144Z";
|
||||
|
||||
export const siteName = "Inasa Healthcare";
|
||||
|
||||
@ -31,9 +31,12 @@ import { Link as Link, Body as Body, RemixForm as RemixForm } from "@webstudio-i
|
||||
const Page = (_props: { system: any; }) => {
|
||||
let [WINDMILL_BASE_URL, set$WINDMILL_BASE_URL] = useVariableState<any>("https://windmill.bsidesolutions.net/api")
|
||||
let [BREVO_JWT_TOKEN, set$BREVO_JWT_TOKEN] = useVariableState<any>("VTU7hlcLX0LDE2tyEYIQ1XSe4hVPU10I")
|
||||
let [CONTACT_FORM_WEBHOOK_URL_PATH, set$CONTACT_FORM_WEBHOOK_URL_PATH] = useVariableState<any>("w/bside-hosted-websites/jobs/run/p/f/email_automations/send_a_transactional_email_for_website_contact_form")
|
||||
let [BREVO_API_ACCESS_KEY_LITERAL, set$BREVO_API_ACCESS_KEY_LITERAL] = useVariableState<any>("$res:u/oonyeje/brevo_access_key")
|
||||
let [PROJECT_NAME, set$PROJECT_NAME] = useVariableState<any>("Inasa Healthcare")
|
||||
let [OWNER_CONTACT_DOMAIN, set$OWNER_CONTACT_DOMAIN] = useVariableState<any>("inasahealthcare.com")
|
||||
let [RECAPTCHA_API_KEY, set$RECAPTCHA_API_KEY] = useVariableState<any>("AIzaSyC38BNWhzaCmJWR7PZT1B7KsfWH9zPMGDY")
|
||||
let [RECAPTCHA_KEY, set$RECAPTCHA_KEY] = useVariableState<any>("6LfI0kcsAAAAAFzNYUT50DLtU5RjCbIyOUQ-CXTA")
|
||||
let [CONTACT_FORM_WEBHOOK_URL_PATH, set$CONTACT_FORM_WEBHOOK_URL_PATH] = useVariableState<any>("w/bside-hosted-websites/jobs/run/p/f/email_automations/send_a_transactional_email_for_website_contact_form")
|
||||
return <Body
|
||||
className={`w-element cdh6bof`}>
|
||||
<Slot>
|
||||
@ -228,14 +231,19 @@ className={`w-element crl0oac co9jzi5 c1kps6fe`}>
|
||||
<section
|
||||
id={"contact"}
|
||||
className={`w-element crww4sf cd5fk7w c3g7ft6 c25jnh8 cu62lxz cpd015r cdh6bof ck52z3u`}>
|
||||
<HtmlEmbed
|
||||
code={"<script src=\"https://www.google.com/recaptcha/api.js\" async defer></script>"}
|
||||
executeScriptOnCanvas={false}
|
||||
className={`w-html-embed`} />
|
||||
<div
|
||||
className={`w-element crww4sf c3g7ft6 c4b9143`}>
|
||||
<div
|
||||
className={`w-element crww4sf c99w2b6 c15fz3od c4b9143`}>
|
||||
<RemixForm
|
||||
id={"contact.form"}
|
||||
method={"post"}
|
||||
encType={"application/x-www-form-urlencoded"}
|
||||
action={"?"}
|
||||
method={"post"}
|
||||
className={`w-element cd5fk7w crww4sf c3g7ft6 cpd015r c10x4uj1`}>
|
||||
<div
|
||||
className={`w-element c16ciwp8 c4b9143`}>
|
||||
@ -303,16 +311,26 @@ className={`w-element`} />
|
||||
<br
|
||||
className={`w-element`} />
|
||||
<div
|
||||
className={`w-element crww4sf c99w2b6 c1o3gzl4 cx93287 c1nuvu2f`}>
|
||||
className={`w-element crww4sf c1ukwrqd c1o3gzl4 cx93287 c1nuvu2f c1lll4jc ci596ri`}>
|
||||
<HtmlEmbed
|
||||
code={`<script>\n async function onRecaptcha(token) {\n const waitForJobCompletion = (UUID) => {\n return new Promise(async (resolve, reject) => {\n try {\n const endpoint = \`${WINDMILL_BASE_URL}/w/bside-hosted-websites/jobs_u/completed/get_result_maybe/\${UUID}\`;\n const checkResponse = await fetch(endpoint, {\n method: 'GET',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${BREVO_JWT_TOKEN}\"\n }\n });\n \n const checkData = await checkResponse.json();\n \n if (checkData.completed) {\n document.getElementById('contact.responseMessage').innerText = 'Message sent successfully!';\n console.log('Success'); \n document.getElementById('contact.form').reset(); // Clear the form\n resolve(checkData);\n } else {\n // If not completed, wait for a second then try again\n setTimeout(async () => {\n const result = await waitForJobCompletion(UUID);\n resolve(result);\n }, 1000);\n }\n } catch (error) {\n document.getElementById('contact.responseMessage').innerText = 'Error sending message.';\n console.error('Error:', error);\n reject(error);\n }\n });\n }\n \n const triggerJob = async () => {\n const webhookUrl = \"${WINDMILL_BASE_URL}/w/bside-hosted-websites/jobs/run/p/f/email_automations/send_a_transactional_email_for_website_contact_form\"; \n\nconst name = document.getElementById('contact.name').value;\n const subject = document.getElementById('contact.subject').value;\n const email = document.getElementById('contact.email').value;\n const message = document.getElementById('contact.message').value;\n \n const formData = {\n auth: ${BREVO_API_ACCESS_KEY_LITERAL},\n body: {\n subject,\n sender: {\n name: \"${PROJECT_NAME} Website Correspondance\",\n email: \"site-contact@${OWNER_CONTACT_DOMAIN}\"\n },\n to: [{\n name: 'No Reply | ${PROJECT_NAME}',\n email: \"info@${OWNER_CONTACT_DOMAIN}\"\n }],\n textContent: \`\${name} (\${email}) has sent the following message:\\n\\n\${message}\`,\n subject,\n replyTo: {\n name,\n email\n }\n }\n };\n \n return await fetch(webhookUrl, {\n method: 'POST',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${BREVO_JWT_TOKEN}\"\n },\n body: JSON.stringify(formData) // Send data as JSON\n })\n }\n \n if (!token.length > 0) {\n throw new Error(\"reCaptcha Token Response missing\")\n }\n\n try {\n const response = await fetch(\`https://recaptchaenterprise.googleapis.com/v1/projects/bside-hosted-webistes/assessments?key=${RECAPTCHA_API_KEY}\`, {\n method: 'POST',\n body: JSON.stringify({\n \"event\": {\n token,\n siteKey: "${RECAPTCHA_KEY}",\n }\n })\n })\n\n \n const data = await response.json()\n\n if ('tokenProperties' in data && data.tokenProperties?.valid) {\n if (document.getElementById('contact.form').reportValidity()) {\n const jobTriggerResponse = await triggerJob();\n const UUID = await jobTriggerResponse.text();\n const jobCompletionData = await waitForJobCompletion(UUID);\n \n return jobCompletionData;\n }\n }\n \n } catch (error) {\n console.log(error)\n throw new Error(\"reCaptcha Token Response score failed to verify\") \n }\n }\n</script>`}
|
||||
executeScriptOnCanvas={false}
|
||||
clientOnly={false}
|
||||
className={`w-html-embed`} />
|
||||
<button
|
||||
type={"submit"}
|
||||
className={`w-element c4trja3 c1xunj7p c3hg53i cibf3js cgzvhla c1eeyz1i c1ed0kk c1vub16f c7c6iu c43t0qt`}>
|
||||
data-sitekey={RECAPTCHA_KEY}
|
||||
data-callback={"onRecaptcha"}
|
||||
data-action={"submit"}
|
||||
data-badge={"inline"}
|
||||
data-size={"invisible"}
|
||||
className={`w-element c4trja3 c1xunj7p c3hg53i cibf3js cgzvhla c1eeyz1i c1ed0kk c1vub16f c7c6iu c43t0qt ${"g-recaptcha"}`}>
|
||||
{"Submit"}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
id={"contact.responseMessage"}
|
||||
className={`w-element`} />
|
||||
className={`w-element crww4sf c99w2b6 cx93287 ckqrydf c1ed0fez cjesh6`} />
|
||||
</div>
|
||||
</RemixForm>
|
||||
<div
|
||||
@ -356,10 +374,6 @@ referrerPolicy={"no-referrer-when-downgrade"}
|
||||
className={`w-element cd5fk7w cv9zpwk`} />
|
||||
</div>
|
||||
</div>
|
||||
<HtmlEmbed
|
||||
executeScriptOnCanvas={true}
|
||||
code={`\n<script>\n document.getElementById('contact.form').addEventListener('submit', async function(event) {\n const waitForJobCompletion = (UUID) => {\n return new Promise(async (resolve, reject) => {\n try {\n const endpoint = \`${WINDMILL_BASE_URL}/w/bside-hosted-websites/jobs_u/completed/get_result_maybe/\${UUID}\`;\n const checkResponse = await fetch(endpoint, {\n method: 'GET',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${BREVO_JWT_TOKEN}\"\n }\n });\n \n const checkData = await checkResponse.json();\n \n if (checkData.completed) {\n document.getElementById('contact.responseMessage').innerText = 'Message sent successfully!';\n console.log('Success'); \n document.getElementById('contact.form').reset(); // Clear the form\n resolve(checkData);\n } else {\n // If not completed, wait for a second then try again\n setTimeout(async () => {\n const result = await waitForJobCompletion(UUID);\n resolve(result);\n }, 1000);\n }\n } catch (error) {\n document.getElementById('contact.responseMessage').innerText = 'Error sending message.';\n console.error('Error:', error);\n reject(error);\n }\n });\n }\n \n const triggerJob = async () => {\n const webhookUrl = \"${WINDMILL_BASE_URL}/${CONTACT_FORM_WEBHOOK_URL_PATH}\"; \n\n // const webhookUrl = "https://windmill.bsidesolutions.net/api/w/bside-hosted-websites/jobs/run/p/f/email_automations/send_a_transactional_email_for_website_contact_form"; \n const name = document.getElementById('contact.name').value;\n const subject = document.getElementById('contact.subject').value;\n const email = document.getElementById('contact.email').value;\n const message = document.getElementById('contact.message').value;\n \n const formData = {\n auth: \"${BREVO_API_ACCESS_KEY_LITERAL}\",\n body: {\n subject,\n sender: {\n name: \"Inasa Healthcare Website Correspondance\",\n email: \"site-contact@${OWNER_CONTACT_DOMAIN}\"\n },\n to: [{\n name: 'No Reply | Inasa Healthcare',\n email: \"info@${OWNER_CONTACT_DOMAIN}\"\n }],\n textContent: \`\${name} (\${email}) has sent the following message:\\n\\n\${message}\`,\n subject,\n replyTo: {\n name,\n email\n }\n }\n };\n \n return await fetch(webhookUrl, {\n method: 'POST',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${BREVO_JWT_TOKEN}\"\n },\n body: JSON.stringify(formData) // Send data as JSON\n })\n }\n \n event.preventDefault(); // Prevent default form submission\n const jobTriggerResponse = await triggerJob();\n const UUID = await jobTriggerResponse.text();\n const jobCompletionData = await waitForJobCompletion(UUID);\n return jobCompletionData;\n });\n</script>\n`}
|
||||
className={`w-html-embed`} />
|
||||
</div>
|
||||
</section>
|
||||
</Fragment_1>
|
||||
|
||||
2
app/__generated__/[insurance]._index.tsx
generated
2
app/__generated__/[insurance]._index.tsx
generated
@ -11,7 +11,7 @@ import { Dialog as Dialog, DialogTrigger as DialogTrigger, DialogOverlay as Dial
|
||||
|
||||
export const projectId = "363652e3-9846-4534-acdf-9b2b3c66eec0";
|
||||
|
||||
export const lastPublished = "2026-01-12T08:23:59.138Z";
|
||||
export const lastPublished = "2026-01-13T13:56:21.144Z";
|
||||
|
||||
export const siteName = "Inasa Healthcare";
|
||||
|
||||
|
||||
2
app/__generated__/[services]._index.tsx
generated
2
app/__generated__/[services]._index.tsx
generated
@ -11,7 +11,7 @@ import { Body as Body, Link as Link } from "@webstudio-is/sdk-components-react-r
|
||||
|
||||
export const projectId = "363652e3-9846-4534-acdf-9b2b3c66eec0";
|
||||
|
||||
export const lastPublished = "2026-01-12T08:23:59.138Z";
|
||||
export const lastPublished = "2026-01-13T13:56:21.144Z";
|
||||
|
||||
export const siteName = "Inasa Healthcare";
|
||||
|
||||
|
||||
34
app/__generated__/_index.tsx
generated
34
app/__generated__/_index.tsx
generated
@ -11,7 +11,7 @@ import { Dialog as Dialog, DialogTrigger as DialogTrigger, DialogOverlay as Dial
|
||||
|
||||
export const projectId = "363652e3-9846-4534-acdf-9b2b3c66eec0";
|
||||
|
||||
export const lastPublished = "2026-01-12T08:23:59.138Z";
|
||||
export const lastPublished = "2026-01-13T13:56:21.144Z";
|
||||
|
||||
export const siteName = "Inasa Healthcare";
|
||||
|
||||
@ -53,9 +53,12 @@ import { Dialog as Dialog, DialogTrigger as DialogTrigger, DialogOverlay as Dial
|
||||
const Page = (_props: { system: any; }) => {
|
||||
let [WINDMILL_BASE_URL, set$WINDMILL_BASE_URL] = useVariableState<any>("https://windmill.bsidesolutions.net/api")
|
||||
let [BREVO_JWT_TOKEN, set$BREVO_JWT_TOKEN] = useVariableState<any>("VTU7hlcLX0LDE2tyEYIQ1XSe4hVPU10I")
|
||||
let [CONTACT_FORM_WEBHOOK_URL_PATH, set$CONTACT_FORM_WEBHOOK_URL_PATH] = useVariableState<any>("w/bside-hosted-websites/jobs/run/p/f/email_automations/send_a_transactional_email_for_website_contact_form")
|
||||
let [BREVO_API_ACCESS_KEY_LITERAL, set$BREVO_API_ACCESS_KEY_LITERAL] = useVariableState<any>("$res:u/oonyeje/brevo_access_key")
|
||||
let [PROJECT_NAME, set$PROJECT_NAME] = useVariableState<any>("Inasa Healthcare")
|
||||
let [OWNER_CONTACT_DOMAIN, set$OWNER_CONTACT_DOMAIN] = useVariableState<any>("inasahealthcare.com")
|
||||
let [RECAPTCHA_API_KEY, set$RECAPTCHA_API_KEY] = useVariableState<any>("AIzaSyC38BNWhzaCmJWR7PZT1B7KsfWH9zPMGDY")
|
||||
let [RECAPTCHA_KEY, set$RECAPTCHA_KEY] = useVariableState<any>("6LfI0kcsAAAAAFzNYUT50DLtU5RjCbIyOUQ-CXTA")
|
||||
let [CONTACT_FORM_WEBHOOK_URL_PATH, set$CONTACT_FORM_WEBHOOK_URL_PATH] = useVariableState<any>("w/bside-hosted-websites/jobs/run/p/f/email_automations/send_a_transactional_email_for_website_contact_form")
|
||||
return <Body
|
||||
className={`w-element cfm4hf3 ck6slji cdh6bof`}>
|
||||
<Slot>
|
||||
@ -1179,14 +1182,19 @@ className={`w-image`} />
|
||||
<section
|
||||
id={"contact"}
|
||||
className={`w-element crww4sf cd5fk7w c3g7ft6 c25jnh8 cu62lxz cpd015r cdh6bof ck52z3u`}>
|
||||
<HtmlEmbed
|
||||
code={"<script src=\"https://www.google.com/recaptcha/api.js\" async defer></script>"}
|
||||
executeScriptOnCanvas={false}
|
||||
className={`w-html-embed`} />
|
||||
<div
|
||||
className={`w-element crww4sf c3g7ft6 c4b9143`}>
|
||||
<div
|
||||
className={`w-element crww4sf c99w2b6 c15fz3od c4b9143`}>
|
||||
<RemixForm
|
||||
id={"contact.form"}
|
||||
method={"post"}
|
||||
encType={"application/x-www-form-urlencoded"}
|
||||
action={"?"}
|
||||
method={"post"}
|
||||
className={`w-element cd5fk7w crww4sf c3g7ft6 cpd015r c10x4uj1`}>
|
||||
<div
|
||||
className={`w-element c16ciwp8 c4b9143`}>
|
||||
@ -1254,16 +1262,26 @@ className={`w-element`} />
|
||||
<br
|
||||
className={`w-element`} />
|
||||
<div
|
||||
className={`w-element crww4sf c99w2b6 c1o3gzl4 cx93287 c1nuvu2f`}>
|
||||
className={`w-element crww4sf c1ukwrqd c1o3gzl4 cx93287 c1nuvu2f c1lll4jc ci596ri`}>
|
||||
<HtmlEmbed
|
||||
code={`<script>\n async function onRecaptcha(token) {\n const waitForJobCompletion = (UUID) => {\n return new Promise(async (resolve, reject) => {\n try {\n const endpoint = \`${WINDMILL_BASE_URL}/w/bside-hosted-websites/jobs_u/completed/get_result_maybe/\${UUID}\`;\n const checkResponse = await fetch(endpoint, {\n method: 'GET',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${BREVO_JWT_TOKEN}\"\n }\n });\n \n const checkData = await checkResponse.json();\n \n if (checkData.completed) {\n document.getElementById('contact.responseMessage').innerText = 'Message sent successfully!';\n console.log('Success'); \n document.getElementById('contact.form').reset(); // Clear the form\n resolve(checkData);\n } else {\n // If not completed, wait for a second then try again\n setTimeout(async () => {\n const result = await waitForJobCompletion(UUID);\n resolve(result);\n }, 1000);\n }\n } catch (error) {\n document.getElementById('contact.responseMessage').innerText = 'Error sending message.';\n console.error('Error:', error);\n reject(error);\n }\n });\n }\n \n const triggerJob = async () => {\n const webhookUrl = \"${WINDMILL_BASE_URL}/w/bside-hosted-websites/jobs/run/p/f/email_automations/send_a_transactional_email_for_website_contact_form\"; \n\nconst name = document.getElementById('contact.name').value;\n const subject = document.getElementById('contact.subject').value;\n const email = document.getElementById('contact.email').value;\n const message = document.getElementById('contact.message').value;\n \n const formData = {\n auth: ${BREVO_API_ACCESS_KEY_LITERAL},\n body: {\n subject,\n sender: {\n name: \"${PROJECT_NAME} Website Correspondance\",\n email: \"site-contact@${OWNER_CONTACT_DOMAIN}\"\n },\n to: [{\n name: 'No Reply | ${PROJECT_NAME}',\n email: \"info@${OWNER_CONTACT_DOMAIN}\"\n }],\n textContent: \`\${name} (\${email}) has sent the following message:\\n\\n\${message}\`,\n subject,\n replyTo: {\n name,\n email\n }\n }\n };\n \n return await fetch(webhookUrl, {\n method: 'POST',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${BREVO_JWT_TOKEN}\"\n },\n body: JSON.stringify(formData) // Send data as JSON\n })\n }\n \n if (!token.length > 0) {\n throw new Error(\"reCaptcha Token Response missing\")\n }\n\n try {\n const response = await fetch(\`https://recaptchaenterprise.googleapis.com/v1/projects/bside-hosted-webistes/assessments?key=${RECAPTCHA_API_KEY}\`, {\n method: 'POST',\n body: JSON.stringify({\n \"event\": {\n token,\n siteKey: "${RECAPTCHA_KEY}",\n }\n })\n })\n\n \n const data = await response.json()\n\n if ('tokenProperties' in data && data.tokenProperties?.valid) {\n if (document.getElementById('contact.form').reportValidity()) {\n const jobTriggerResponse = await triggerJob();\n const UUID = await jobTriggerResponse.text();\n const jobCompletionData = await waitForJobCompletion(UUID);\n \n return jobCompletionData;\n }\n }\n \n } catch (error) {\n console.log(error)\n throw new Error(\"reCaptcha Token Response score failed to verify\") \n }\n }\n</script>`}
|
||||
executeScriptOnCanvas={false}
|
||||
clientOnly={false}
|
||||
className={`w-html-embed`} />
|
||||
<button
|
||||
type={"submit"}
|
||||
className={`w-element c4trja3 c1xunj7p c3hg53i cibf3js cgzvhla c1eeyz1i c1ed0kk c1vub16f c7c6iu c43t0qt`}>
|
||||
data-sitekey={RECAPTCHA_KEY}
|
||||
data-callback={"onRecaptcha"}
|
||||
data-action={"submit"}
|
||||
data-badge={"inline"}
|
||||
data-size={"invisible"}
|
||||
className={`w-element c4trja3 c1xunj7p c3hg53i cibf3js cgzvhla c1eeyz1i c1ed0kk c1vub16f c7c6iu c43t0qt ${"g-recaptcha"}`}>
|
||||
{"Submit"}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
id={"contact.responseMessage"}
|
||||
className={`w-element`} />
|
||||
className={`w-element crww4sf c99w2b6 cx93287 ckqrydf c1ed0fez cjesh6`} />
|
||||
</div>
|
||||
</RemixForm>
|
||||
<div
|
||||
@ -1307,10 +1325,6 @@ referrerPolicy={"no-referrer-when-downgrade"}
|
||||
className={`w-element cd5fk7w cv9zpwk`} />
|
||||
</div>
|
||||
</div>
|
||||
<HtmlEmbed
|
||||
executeScriptOnCanvas={true}
|
||||
code={`\n<script>\n document.getElementById('contact.form').addEventListener('submit', async function(event) {\n const waitForJobCompletion = (UUID) => {\n return new Promise(async (resolve, reject) => {\n try {\n const endpoint = \`${WINDMILL_BASE_URL}/w/bside-hosted-websites/jobs_u/completed/get_result_maybe/\${UUID}\`;\n const checkResponse = await fetch(endpoint, {\n method: 'GET',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${BREVO_JWT_TOKEN}\"\n }\n });\n \n const checkData = await checkResponse.json();\n \n if (checkData.completed) {\n document.getElementById('contact.responseMessage').innerText = 'Message sent successfully!';\n console.log('Success'); \n document.getElementById('contact.form').reset(); // Clear the form\n resolve(checkData);\n } else {\n // If not completed, wait for a second then try again\n setTimeout(async () => {\n const result = await waitForJobCompletion(UUID);\n resolve(result);\n }, 1000);\n }\n } catch (error) {\n document.getElementById('contact.responseMessage').innerText = 'Error sending message.';\n console.error('Error:', error);\n reject(error);\n }\n });\n }\n \n const triggerJob = async () => {\n const webhookUrl = \"${WINDMILL_BASE_URL}/${CONTACT_FORM_WEBHOOK_URL_PATH}\"; \n\n // const webhookUrl = "https://windmill.bsidesolutions.net/api/w/bside-hosted-websites/jobs/run/p/f/email_automations/send_a_transactional_email_for_website_contact_form"; \n const name = document.getElementById('contact.name').value;\n const subject = document.getElementById('contact.subject').value;\n const email = document.getElementById('contact.email').value;\n const message = document.getElementById('contact.message').value;\n \n const formData = {\n auth: \"${BREVO_API_ACCESS_KEY_LITERAL}\",\n body: {\n subject,\n sender: {\n name: \"Inasa Healthcare Website Correspondance\",\n email: \"site-contact@${OWNER_CONTACT_DOMAIN}\"\n },\n to: [{\n name: 'No Reply | Inasa Healthcare',\n email: \"info@${OWNER_CONTACT_DOMAIN}\"\n }],\n textContent: \`\${name} (\${email}) has sent the following message:\\n\\n\${message}\`,\n subject,\n replyTo: {\n name,\n email\n }\n }\n };\n \n return await fetch(webhookUrl, {\n method: 'POST',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer ${BREVO_JWT_TOKEN}\"\n },\n body: JSON.stringify(formData) // Send data as JSON\n })\n }\n \n event.preventDefault(); // Prevent default form submission\n const jobTriggerResponse = await triggerJob();\n const UUID = await jobTriggerResponse.text();\n const jobCompletionData = await waitForJobCompletion(UUID);\n return jobCompletionData;\n });\n</script>\n`}
|
||||
className={`w-html-embed`} />
|
||||
</div>
|
||||
</section>
|
||||
</Fragment_1>
|
||||
|
||||
9
app/__generated__/index.css
generated
9
app/__generated__/index.css
generated
@ -1289,6 +1289,9 @@
|
||||
.ctcym5x {
|
||||
font-size: 20px
|
||||
}
|
||||
.c1ukwrqd {
|
||||
flex-direction: column-reverse
|
||||
}
|
||||
.c1wob7x0 {
|
||||
width: 75%
|
||||
}
|
||||
@ -1334,6 +1337,12 @@
|
||||
.co1ppcl {
|
||||
color: rgba(223, 157, 17, 1)
|
||||
}
|
||||
.c1ed0fez {
|
||||
margin-top: 1rem
|
||||
}
|
||||
.cjesh6 {
|
||||
font-size: 1.6rem
|
||||
}
|
||||
}
|
||||
@media all and (max-width: 991px) {
|
||||
.c1fu4nwy {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user