<?php
/** @var \Magento\Framework\View\Element\Template $block */
/** @var \Dotdigitalgroup\Email\Helper\Data $helper */
?>
<?php $helper = $this->helper(\Dotdigitalgroup\Email\Helper\Data::class); ?>

<?php if ($helper->isEasyEmailCaptureEnabled()) : ?>
    <script type="text/x-magento-init">
    {
        "*": {
            "Dotdigitalgroup_Email/js/emailCapture":{
                "type":"checkout",
                "url":"<?= $block->escapeHtml($helper->getEmailCaptureUrl()); ?>"
            }
        }
    }
    </script>
<?php endif; ?>