On my magento 2.4 I've enabled magento's google recaptcha from the security settings and I have enabled it for newsletter subscription form.
On my website, I have two instances of the subscription form: one in footer, and another one in the home page.
Both calls the default Subscribe block, but the footer form is the default subscribe.phtml template while for the other one I create a phtml template in the design folder, then created a cms static block that calls this template with:
{{block class="Magento\Newsletter\Block\Subscribe" name="static.newsletter" template="Magento_Newsletter::static-subscribe.phtml"}}
On the footer form, everything works as expected, including the invisible captcha, while on the other form, the form itself works but there is no captcha.
How can I have the captcha on the custom form as well?
On magento default recaptcha-newsletter module, magento called the recaptcha block by a referenceContainer to the footer handle. My custom template, however, is not inside the footer handle, therefore the recaptcha block is not called. I think I have to create a custom xml layout, call the appropriate handle and call the recaptcha block from there, but I don't know what the appropriate handle is for a cms block. I tried with a referenceBlock to both the identifier and the name of the block that I set on the backend, but none work.