prototype mailchimp sending to test account, might be ditched for other technique

This commit is contained in:
Matthias Kretschmann 2015-12-21 17:38:52 +01:00
parent f8f64e5c9e
commit d107c2d6ea
2 changed files with 16 additions and 11 deletions

View File

@ -8,8 +8,7 @@ var FormEarlyAccess = (function(w, d, $) {
_config = {
form: $('#form-earlyaccess'),
formBtn: $('#form-earlyaccess').find('.btn'),
formURL: $('#form-earlyaccess').attr('action'),
formMethod: $('#form-earlyaccess').attr('method')
formURL: $('#form-earlyaccess').attr('action')
};
_private = {
@ -18,13 +17,19 @@ var FormEarlyAccess = (function(w, d, $) {
e.preventDefault();
if ( $(this).parsley().isValid() ) {
var data = {};
var dataArray = _config.form.serializeArray();
$.each(dataArray, function (index, item) {
data[item.name] = item.value;
});
$.ajax({
url: _config.formURL,
method: _config.formMethod,
data: $(this).serialize(),
// dataType: 'json',
// contentType: 'application/json',
// crossDomain: true,
url: _config.formURL.replace('/post?', '/post-json?').concat('&c=?'),
data: data,
dataType: 'jsonp',
contentType: 'application/json; charset=utf-8',
crossDomain: true,
beforeSend: function() {
_config.formBtn
.addClass('disabled')

View File

@ -61,14 +61,14 @@ front_page: true
<p class="section-description">For early access and inquiries, enter your contact information below</p>
</header>
<form id="form-earlyaccess" class="js-parsley" action="" method="POST">
<form id="form-earlyaccess" class="js-parsley" action="http://mkretschmann.us4.list-manage1.com/subscribe/post?u=96b695f2a4b06978eaf714c27&id=3fbe27c491" method="POST">
<p class="form-group">
<input class="form-control" type="text" id="name" name="name" required>
<label class="form-label" for="name">Your Name</label>
</p>
<p class="form-group">
<input class="form-control" type="email" id="email" name="email" required>
<label class="form-label" for="email">Your Email</label>
<input class="form-control" type="email" id="EMAIL" name="EMAIL" required>
<label class="form-label" for="EMAIL">Your Email</label>
</p>
<p class="form-group">
<textarea class="form-control" id="comment" name="comment" rows="1"></textarea>