- add quotes around auth
This commit is contained in:
parent
10a33e006b
commit
14aeb69660
@ -1,10 +1,10 @@
|
||||
{
|
||||
"build": {
|
||||
"id": "a1a86306-3d77-4eb6-96f2-051b0f8c8c3b",
|
||||
"id": "80134095-0c10-4a4d-9328-d5407cbf8f2a",
|
||||
"projectId": "363652e3-9846-4534-acdf-9b2b3c66eec0",
|
||||
"version": 5726,
|
||||
"createdAt": "2026-01-13T13:56:21.144+00:00",
|
||||
"updatedAt": "2026-01-13T13:56:21.144+00:00",
|
||||
"version": 5728,
|
||||
"createdAt": "2026-01-13T20:52:37.497+00:00",
|
||||
"updatedAt": "2026-01-13T20:52:37.497+00:00",
|
||||
"pages": {
|
||||
"meta": {
|
||||
"siteName": "Inasa Healthcare",
|
||||
@ -34381,7 +34381,7 @@
|
||||
"instanceId": "FWErf923dUrcCtRUj8GsR",
|
||||
"name": "code",
|
||||
"type": "expression",
|
||||
"value": "`\\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 = \\`${$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}/${$ws$dataSource$DQMy1uq8RqjZWPsiXfW7d}\\\"; \\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: \\\"${$ws$dataSource$Dczntj_56W3g4wZnKmj8I}\\\",\\n body: {\\n subject,\\n sender: {\\n name: \\\"Inasa Healthcare Website Correspondance\\\",\\n email: \\\"site-contact@${$ws$dataSource$Q8IuHMpgxoh8_RHrPMmfT}\\\"\\n },\\n to: [{\\n name: 'No Reply | Inasa Healthcare',\\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 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`"
|
||||
"value": "`\\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 = \\`${$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}/${$ws$dataSource$DQMy1uq8RqjZWPsiXfW7d}\\\"; \\n\\n\\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: \\\"${$ws$dataSource$Dczntj_56W3g4wZnKmj8I}\\\",\\n body: {\\n subject,\\n sender: {\\n name: \\\"Inasa Healthcare Website Correspondance\\\",\\n email: \\\"site-contact@${$ws$dataSource$Q8IuHMpgxoh8_RHrPMmfT}\\\"\\n },\\n to: [{\\n name: 'No Reply | Inasa Healthcare',\\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 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`"
|
||||
}
|
||||
],
|
||||
[
|
||||
@ -35921,7 +35921,7 @@
|
||||
"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>`"
|
||||
"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>`"
|
||||
}
|
||||
],
|
||||
[
|
||||
|
||||
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-13T13:56:21.144Z";
|
||||
export const lastPublished = "2026-01-13T20:52:37.497Z";
|
||||
|
||||
export const siteName = "Inasa Healthcare";
|
||||
|
||||
|
||||
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-13T13:56:21.144Z";
|
||||
export const lastPublished = "2026-01-13T20:52:37.497Z";
|
||||
|
||||
export const siteName = "Inasa Healthcare";
|
||||
|
||||
|
||||
4
app/__generated__/[contact]._index.tsx
generated
4
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-13T13:56:21.144Z";
|
||||
export const lastPublished = "2026-01-13T20:52:37.497Z";
|
||||
|
||||
export const siteName = "Inasa Healthcare";
|
||||
|
||||
@ -313,7 +313,7 @@ className={`w-element`} />
|
||||
<div
|
||||
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>`}
|
||||
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`} />
|
||||
|
||||
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-13T13:56:21.144Z";
|
||||
export const lastPublished = "2026-01-13T20:52:37.497Z";
|
||||
|
||||
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-13T13:56:21.144Z";
|
||||
export const lastPublished = "2026-01-13T20:52:37.497Z";
|
||||
|
||||
export const siteName = "Inasa Healthcare";
|
||||
|
||||
|
||||
4
app/__generated__/_index.tsx
generated
4
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-13T13:56:21.144Z";
|
||||
export const lastPublished = "2026-01-13T20:52:37.497Z";
|
||||
|
||||
export const siteName = "Inasa Healthcare";
|
||||
|
||||
@ -1264,7 +1264,7 @@ className={`w-element`} />
|
||||
<div
|
||||
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>`}
|
||||
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`} />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user