2
我在角度應用中使用了formspree。除了我似乎無法改變電子郵件的主題外,一切都在運作。用ajax改變formpree的主題
HTML ...
<form id="bookingForm" action="https://formspree.io/[email protected]"
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>
JS ...
$bookingForm = $('#bookingForm');
$bookingForm.submit(function(e) {
e.preventDefault();
$.ajax({
url: '//formspree.io/[email protected]',
method: 'POST',
data: {
client: $scope.client.name,
email: $scope.client.email,
phone: $scope.client.phone,
// some other info
},
dataType: 'json',
});
});
的_replyto似乎是工作,但_subject不是。