diff --git a/cigaradvisor/blocks/contest-form/contest-form.js b/cigaradvisor/blocks/contest-form/contest-form.js index f7ee39a6..e2afdf56 100644 --- a/cigaradvisor/blocks/contest-form/contest-form.js +++ b/cigaradvisor/blocks/contest-form/contest-form.js @@ -1,13 +1,16 @@ +import { readBlockConfig } from '../../scripts/aem.js'; + export default async function decorate(block) { + const config = readBlockConfig(block); const iframeWrapper = document.createElement('div'); - iframeWrapper.id = 'vsscript_148868_314195'; + iframeWrapper.id = config.formid; block.replaceChildren(iframeWrapper); const p = document.createElement('p'); function loadScript() { const script = document.createElement('script'); script.async = true; script.type = 'text/javascript'; - script.src = 'https://app.viralsweep.com/vsa-widget-bedfd7-148868.js?sid=148868_314195'; + script.src = config.formurl; p.appendChild(script); } block.appendChild(p);