{if $settings->site_key}
<style>.grecaptcha-badge { visibility: hidden; }</style>
<script src="https://www.google.com/recaptcha/api.js?render={$settings->site_key}"></script>
<script>
    grecaptcha.ready(function() {
        grecaptcha.execute('{$settings->site_key}', { action: 'submit' }).then(function(token) {
            grecaptcha.value = token;
            $("form").find("input[name='recaptcha_response']").val(token);
        });
    });
</script>
{/if}
