{"id":1138,"date":"2024-06-28T12:19:28","date_gmt":"2024-06-28T19:19:28","guid":{"rendered":"https:\/\/staging.infonews.ca\/inwine\/?page_id=1138"},"modified":"2026-02-02T14:49:58","modified_gmt":"2026-02-02T22:49:58","slug":"newsletter-signup","status":"publish","type":"page","link":"https:\/\/staging.infonews.ca\/inwine\/newsletter-signup\/","title":{"rendered":"Newsletter Signup"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Newsletter Signup<\/h1>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-c509e09b wp-block-group-is-layout-flex\" style=\"margin-bottom:var(--wp--preset--spacing--50)\">\n<h3 class=\"wp-block-heading\">Elevate your local knowledge.<\/h3>\n\n\n\n<p>Be the first to know about breaking news, exclusive stories, and community events. Don&#8217;t miss out \u2013 stay informed and stay connected.<\/p>\n\n\n\n<p>Sign up for the <strong>iNFO<\/strong><em>news<\/em> newsletter today!<\/p>\n<\/div>\n\n\n        <div id=\"letterhead-signup\">\n\t\t\t            <form\n                id=\"letterhead-signup-form\"\n                action=\"https:\/\/staging.infonews.ca\/inwine\/wp-admin\/admin-ajax.php\"\n                method=\"post\"\n            >\n                <input type=\"hidden\" name=\"action\" value=\"infotel_letterhead_subscribe\">\n                <input type=\"hidden\" id=\"letterhead_nonce\" name=\"letterhead_nonce\" value=\"70e4a24623\" \/><input type=\"hidden\" name=\"_wp_http_referer\" value=\"\/inwine\/wp-json\/wp\/v2\/pages\/1138\" \/>\n                <input\n                    id=\"letterhead-honey\"\n                    type=\"text\"\n                    name=\"company_website\"\n                    value=\"\"\n                    tabindex=\"-1\"\n                    autocomplete=\"off\"\n                    aria-hidden=\"true\"\n                    style=\"position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;\"\n                >\n\n                \n                <div class=\"form__group\">\n                    <div class=\"form__group__field flex\">\n                        <select\n                            id=\"letterhead-region-select\"\n                            name=\"region\"\n                            class=\"form__input region\"\n                            required\n                        >\n                                                            <option\n                                    value=\"kamloops\"\n                                    selected                                >\n                                    Kamloops                                <\/option>\n                                                            <option\n                                    value=\"kelowna\"\n                                                                    >\n                                    Kelowna                                <\/option>\n                                                            <option\n                                    value=\"penticton\"\n                                                                    >\n                                    Penticton                                <\/option>\n                                                            <option\n                                    value=\"vernon\"\n                                                                    >\n                                    Vernon                                <\/option>\n                                                    <\/select>\n\n                        <input\n                            id=\"email\"\n                            type=\"email\"\n                            name=\"email\"\n                            class=\"form__input email\"\n                            required\n\t\t\t\t\t\t\tplaceholder=\"Enter your Email\"\n                        >\n\n                        <button\n                            type=\"submit\"\n                            class=\"form__group__field__submit-button items-center button button--secondary\"\n                        >\n                            Subscribe\n                        <\/button>\n                    <\/div>\n                <\/div>\n            <\/form>\n            <div id=\"letterhead-signup-message\" style=\"display:none;margin-top:8px;\"><\/div>\n        <\/div>\n\n\t\t<script>\n\t\t(() => {\n            const recaptchaEnabled = false;\n            const recaptchaVersion = 'disabled';\n            const recaptchaSiteKey = '';\n\n            const init = () => {\n                const forms = document.querySelectorAll('#letterhead-signup-form');\n                if (!forms.length) {\n                    return;\n                }\n\n                forms.forEach(form => {\n                    if (form.dataset.bound === '1') {\n                        return;\n                    }\n\n                    form.dataset.bound = '1';\n\n                    const container = form.closest('#letterhead-signup') || form.parentElement;\n                    const message = container ? container.querySelector('#letterhead-signup-message') : null;\n                    const submit = form.querySelector('button[type=\"submit\"]');\n                    const honey = form.querySelector('input[name=\"company_website\"]');\n                    const recaptchaInput = form.querySelector('input[name=\"g-recaptcha-response\"]');\n\n                    const showMessage = (text, isError) => {\n                        if (!message) {\n                            return;\n                        }\n\n                        message.textContent = text;\n                        message.style.display = 'block';\n                        message.style.color = isError ? '#b91c1c' : '#15803d';\n                    };\n\n                    const clearMessage = () => {\n                        if (!message) {\n                            return;\n                        }\n\n                        message.textContent = '';\n                        message.style.display = 'none';\n                    };\n\n                    const setLoading = loading => {\n                        if (!submit) {\n                            return;\n                        }\n\n                        submit.disabled = loading;\n                        submit.textContent = loading ? 'Submitting...' : 'Subscribe';\n                    };\n\n                    form.addEventListener('submit', event => {\n                        event.preventDefault();\n                        clearMessage();\n\n                        if (honey && honey.value !== '') {\n                            showMessage('Unable to process this request.', true);\n                            return;\n                        }\n\n                        const formData = new FormData(form);\n\n                        const submitForm = () => {\n                        const submitUrl = form.getAttribute('action') || '';\n                        fetch(submitUrl, {\n                                method: 'POST',\n                                body: formData,\n                                credentials: 'same-origin',\n                            })\n                                .then(response => response.json())\n                                .then(data => {\n                                    if (data && data.success) {\n                                        const successMessage = data.data && data.data.message ? data.data.message : 'Thanks for subscribing.';\n                                        showMessage(successMessage, false);\n                                        form.reset();\n                                        return;\n                                    }\n\n                                    const errorMessage = data && data.data && data.data.message\n                                        ? data.data.message\n                                        : 'Subscription failed. Please try again.';\n                                    showMessage(errorMessage, true);\n                                })\n                                .catch(() => {\n                                    showMessage('Subscription failed. Please try again.', true);\n                                })\n                                .finally(() => {\n                                    setLoading(false);\n                                });\n                        };\n\n                        setLoading(true);\n\n                        if (recaptchaEnabled && recaptchaVersion === 'recaptchav3') {\n                            if (\n                                !recaptchaInput ||\n                                typeof window.grecaptcha === 'undefined' ||\n                                typeof window.grecaptcha.ready !== 'function' ||\n                                typeof window.grecaptcha.execute !== 'function'\n                            ) {\n                                setLoading(false);\n                                showMessage('reCAPTCHA is not ready. Please refresh and try again.', true);\n                                return;\n                            }\n\n                            window.grecaptcha.ready(() => {\n                                window.grecaptcha.execute(recaptchaSiteKey, { action: 'newsletter_signup' })\n                                    .then(token => {\n                                        if (!token) {\n                                            throw new Error('No token');\n                                        }\n\n                                        recaptchaInput.value = token;\n                                        formData.set('g-recaptcha-response', token);\n                                        submitForm();\n                                    })\n                                    .catch(() => {\n                                        setLoading(false);\n                                        showMessage('reCAPTCHA verification failed. Please try again.', true);\n                                    });\n                            })\n                            return;\n                        }\n\n                        submitForm();\n                    });\n                });\n            };\n\n            if (document.readyState === 'loading') {\n                document.addEventListener('DOMContentLoaded', init);\n            } else {\n                init();\n            }\n\t\t})();\n\t\t<\/script>\n        \n","protected":false},"excerpt":{"rendered":"<p>Newsletter Signup Elevate your local knowledge. Be the first to know about breaking news, exclusive stories, and community events. Don&#8217;t miss out \u2013 stay informed and stay connected. Sign up for the iNFOnews newsletter today!<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1138","page","type-page","status-publish","hentry"],"blocksy_meta":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/staging.infonews.ca\/inwine\/wp-json\/wp\/v2\/pages\/1138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.infonews.ca\/inwine\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/staging.infonews.ca\/inwine\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/staging.infonews.ca\/inwine\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.infonews.ca\/inwine\/wp-json\/wp\/v2\/comments?post=1138"}],"version-history":[{"count":2,"href":"https:\/\/staging.infonews.ca\/inwine\/wp-json\/wp\/v2\/pages\/1138\/revisions"}],"predecessor-version":[{"id":3912,"href":"https:\/\/staging.infonews.ca\/inwine\/wp-json\/wp\/v2\/pages\/1138\/revisions\/3912"}],"wp:attachment":[{"href":"https:\/\/staging.infonews.ca\/inwine\/wp-json\/wp\/v2\/media?parent=1138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}