How use action-xhr and admin-post to send AMP form email


Staff member
I have a website in wordpress and I am doing some pages in AMP, but I need to make a compatible form with AMP, <a href="" rel="nofollow noreferrer">here</a> I have the documentation, I'm having some difficulties mainly to connect the "action-xhr" with wordpress. I tried to make an eternal file but I had origin-across error.
<a href=" " rel="nofollow noreferrer"><img src=" " alt="enter image description here"></a>

&lt;form target="_top" action-xhr="" method="post" name="test"&gt;
        &lt;input type="text" name="name" value="Name"&gt;
        &lt;input type="submit"/&gt;