I have integrated formspree into my Angular application successfully, but I am facing an issue with changing the subject of the email.
Here is the HTML code snippet:
<form id="bookingForm" action="https://formspree.io/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e990869c9ba98c84888085c78a8684">[email protected]</a>"
method="POST">
<input type="text" name="{{client.name}}">
<input type="{{client.email}}" name="_replyto">
<input type="hidden" name="_subject" value="Request from {{client.name}}">
<!-- some other info -->
<input type="submit" value="Send">
</form>
And here is the JavaScript code snippet:
$bookingForm = $('#bookingForm');
$bookingForm.submit(function(e) {
e.preventDefault();
$.ajax({
url: '//formspree.io/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ff6e0fafdcfeae2eee6e3a1ece0e2">[email protected]</a>',
method: 'POST',
data: {
client: $scope.client.name,
email: $scope.client.email,
phone: $scope.client.phone,
// some other info
},
dataType: 'json',
});
});
The _replyto functionality is working fine, but I am unable to get the _subject to work as expected.